VS2015 cannot parse external symbol __imp__fprintf

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.