0

我正在使用 VS 2013 在 Windows 7 64 位中编程。我已经有一个在 Linux 64 位中开发的代码。该代码充满了 sprintf() 函数。

现在,我在 Windows 64 位中运行该代码,它显示警报窗口。起初,我尝试了 sprintf,它显示使用 sprintf_s。所以我改变了。

更改后我的代码窗口显示此错误。

Program : ...visual studio
2012\Project\IIS_Partial\Debug\IIS_Partial.exe
File : f\dd\vctools\crt_bld\self_x86\crt\src\vsprintf.c
Line : 233

Expression : format != NULL

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press retry to debug the application)

实际上我的代码是用 C 编写的。为什么这是指 C++。而且我什至可以调试,因为直接按“调试”按钮会进入这个错误窗口。有什么线索吗?

感谢阅读:D

4

1 回答 1

0

这只是一个简单的配置问题。基本上 Microsoft Visual Studio 2012 编译为 32 位。

因此,如果有人想以 64 位运行源代码,则必须更改选项。

右键单击[solution] -> [properties] -> [Configuration] -> [Configuration Manager](窗口右上角) -> [Active Solution Platform] flow Menu -> -> upper is 'x64' and lower is 'Win32'。检查下面的框。

并确认。现在它建立在 64 位环境中。微软官方网站的原始解释是:http: //msdn.microsoft.com/en-us/library/vstudio/9yb4317s.aspx

于 2013-09-09T04:52:38.953 回答