
TomasCvincek asked a question.
Hello guys,
I am updating Flexnet on our software and I am facing following error:
libredir_std.lib(lm_redir_std.obj) : error LNK2019: unresolved external symbol __iob_func referenced in function lm_flex_stderr.
I am updating Flexnet from version 11.14 to 11.18.
I found some hints on stackoverflow:
https://stackoverflow.com/questions/30412951/unresolved-external-symbol-imp-fprintf-and-imp-iob-func-sdl2
I implemented missing function where needed on my own:
- FILE _iob[] = {*stdin, *stdout, *stderr};extern "C" FILE * __cdecl __iob_func(void){ return _iob;}
With this function implemented in DLLs that require Flexnet, it compiles successfully and runtime seems OK as well.
But I do not think this is good solution - it is more like a workaround. Why does libredir_std.lib requires this function? When I checked Flexnet version 11.14, it used __acrt_iob_func instead of __iob_func.
How can I fix this? Is there any other way to do it than defining this function on my own?
I build our app using Visual Studio 2015. Here are dependencies:
- FNP_Act_InstallerlibFNPloadlibcrvslibFNPloadliblmutillibpthreadlibsblibsimplifierlmgrlmgraslmgrd lmgrslmgr_donglelmgr_dongle_stublmgr_trllmsignlibredir_std.libuserenv.libiphlpapi.liblegacy_stdio_wide_specifiers.liblegacy_stdio_definitions.lib
linker options:
- lm_new.obj /NODEFAULTLIB:LIBCMT.lib
Thanks for answers in advance.
Tomas C.
Hi @mrathinam ,
I have probably used wrong distribution of Flexnet (for newer Visual Studio).
When I used correct one for Visual Studio 2015, this __iob_func is not used. __acrt_iob_func is used instead of __iob_func.
Thanks.Tomas C.