Using vs2015 to compile a small ffmpeg, there are __imp__fprintf and __imp____iob_func errors, Google a bit, some people recommend to download the SDL source code recompile, of course, this program is very unscientific. So continue to search, finally found something.
This is the foreigner's exact words:
In Visual Studio, stdin, stderr, stdout is 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 are not defined anymore which leads to a link error when using a. lib file compiled with previous version S 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 on stdio functions (in my case it sprintf()
is), you can add legacy_stdio_definitions. LIB to your linker options.
Answer the meaning is stdin, stderr, stdout these functions vs2015 and the previous definition is not the same, so error.
The workaround is to use the {*stdin,*stdout,*stderr} array to define it yourself __iob_func ()
It's actually the bottom.
extern " C " {FILE __iob_func[3] = {*stdin,*stdout,*stderr};}
Then the __imp__fprintf solution is to add legacy_stdio_definitions.lib to the LIB in the linker input lib.
VS2015 cannot parse external symbol __imp__fprintf