unresolved external symbol __imp__fprintf and __imp____iob_func, SDL2
I have finally figured out why this is happening !
In visual studio 2015, stdin, stderr, stdout are defined as follow :
#define stdin (__acrt_iob_func(0))
#define stdout (__acrt_iob_func(1))
#define stderr (__acrt_iob_func(2))
But previously, they were defined as:
#define stdin (&__iob_func()[0])
#define stdout (&__iob_func()[1])
#define stderr (&__iob_func()[2])
So now __iob_func is not defined anymore which leads to a link error when using a .lib file compiled with previous versions of visual studio.
To solve the issue, you can try defining __iob_func()
yourself which should return an array containing {*stdin,*stdout,*stderr}
.
Regarding the other link errors about stdio functions (in my case it was sprintf()
), you can add legacy_stdio_definitions.lib to your linker options.
Visual Studio 15 __imp___iob, __imp___pctype, __imp___mb_cur_max
The libraries were compiled against an old version of the CRT. The unresolved symbols you get are internal symbols of the CRT that are present in the compiled library. You have to recompile the library against the VS2015 CRT (the Universal CRT). But I'm not sure if MinGW supports this.
If you can't do that, you have to continue to use the VS2013 compiler. (You can use the VS2015 IDE, by setting the toolset to vs2013 in the project options. But you'll still be limited to the C++ features the 2013 compiler supports.)
Related Topics
What Are the Gcc Default Include Directories
How to Call a Base Class'S Virtual Function If I'M Overriding It
Determine the Line of Code That Causes a Segmentation Fault
When Should I Use Std::Thread::Detach
How to Convert a Lambda to an Std::Function Using Templates
How Does Generic Lambda Work in C++14
How to Perform a Bitwise Operation on Floating Point Numbers
Remove Elements of a Vector Inside the Loop
Benefits of Initialization Lists
How to Create a Byte Out of 8 Bool Values (And Vice Versa)
Are Flexible Array Members Valid in C++
Fastest Way to Determine If an Integer Is Between Two Integers (Inclusive) With Known Sets of Values
Error: Request For Member '..' in '..' Which Is of Non-Class Type