gpt4 book ai didi

c++ - VS2017 #错误 : : Macro definition of snprintf conflicts with Standard Library function declaration

转载 作者:行者123 更新时间:2023-11-27 22:37:41 31 4
gpt4 key购买 nike

我正在尝试使用 VS2017 构建在 VS 2010 中开发的应用程序。当我构建应用程序时,出现以下错误:

error: : Macro definition of snprintf conflicts with Standard Library function declaration

我试图像 here 那样解决这个问题.但这对我不起作用。

我正在使用 Windows 10 和 VS2017 社区 15.8.2。

最佳答案

正如您问题中的错误所示,您的 snprintf 宏定义不再与您当前的版本兼容。

所以你需要寻找以下内容:

#define snprintf _snprintf

您可以删除它,或者如果您还需要使用 Visual Studio 2010 编译代码,您可以添加以下条件:

#if _MSC_VER < 1700 
#define snprintf _snprintf
#endif

关于c++ - VS2017 #错误 : : Macro definition of snprintf conflicts with Standard Library function declaration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52179282/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com