C++: Unresolved external symbol _sprintf and _sscanf in Visual Studio 2015

前端 未结 2 1300
半阙折子戏
半阙折子戏 2020-12-04 09:34

For a research project, I\'m writing a C++ add-on to a scientific computing language. Unfortunately the library that allows users to do this is not kept very well up-to-date

相关标签:
2条回答
  • 2020-12-04 10:10

    Add the following library to the linker input files:

    legacy_stdio_definitions.lib
    

    VS 2015 now uses inline definitions that call internal functions for many of the stdio.h functions. If an object file (or library member) depends on one of those functions, then the legacy_stdio_definitions.lib provides an externally linkable version of the function that can be linked to.

    Your other option is to recompile the unit that depends on those functions with VS 2015 (this is probably the preferred option).

    0 讨论(0)
  • 2020-12-04 10:30

    I got this error compiling cycling max plugins against version 5 max sdk (pure c api). The legacy library fix didn't work for me (it should have, and if anyone had any idea why it mightn't I'd be curious), but I defined _NO_CRT_STDIO_INLINE before stdio was loaded and that did do the trick.

    0 讨论(0)
提交回复
热议问题