在Visual Studio 2010中构建C代码时,cmath中的一堆编译错误



我试图在VS2010中编译C代码。当我这样做时,我在cmath中得到了714个错误,我甚至没有包含这个文件。

以下是包含的文件:http://pastebin.com/LzsDfEcr

错误都是相同的"样式",例如:

Error   711 error C2061: syntax error : identifier 'ceil'   c:program files (x86)microsoft visual studio 10.0vcincludecmath    40
Error   712 error C2059: syntax error : ';' c:program files (x86)microsoft visual studio 10.0vcincludecmath    40

,然后用另一个标识符出现同样的两个错误。

我在C/c++ ->高级下有编译为C,项目中的所有文件都是。C文件。

<cmath>是一个c++头文件。它可能包含在其他c++头文件中。看看你的代码,我可以看到你包括<string><sstream>,这两个都是c++头文件。

//#include <unistd.h> // doesn't exist in vs2010?

unistd.h是Unix头文件

最新更新