Home >Backend Development >C++ >Why Do I Get Unresolved External Symbols __imp__fprintf and __imp____iob_func in Visual Studio 2015?

Why Do I Get Unresolved External Symbols __imp__fprintf and __imp____iob_func in Visual Studio 2015?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-28 07:13:14515browse

Why Do I Get Unresolved External Symbols __imp__fprintf and __imp____iob_func in Visual Studio 2015?

Unraveling the Mystery of Unresolved External Symbols: __imp__fprintf and __imp____iob_func

Your compilation errors indicate that the linker cannot find the necessary definitions for two external symbols: __imp__fprintf and __imp____iob_func. These symbols are related to input and output operations.

In Visual Studio 2015, changes to the definition of stdin, stderr, and stdout have introduced this error. Previously defined as __iob_func(), these symbols are now defined differently. This inconsistency leads to linking problems with libraries compiled using older versions of Visual Studio.

To resolve this issue, you can define __iob_func() as an array containing {stdin,stdout,*stderr} within your code. Additionally, adding legacy_stdio_definitions.lib to your linker options can address the errors related to stdio functions, such as sprintf().

By following these steps, you can resolve the unresolved external symbol errors and successfully compile your SDL2 program.

The above is the detailed content of Why Do I Get Unresolved External Symbols __imp__fprintf and __imp____iob_func in Visual Studio 2015?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn