Bunch of compilation errors in cmath when building C code in Visual Studio 2010
I'm trying to compile C code in VS2010. When I do, I get 714 errors in cmath, a file I haven't even included.
Here are the included files: http://pastebin.com/LzsDfEcr
The errors are all the same "style", e开发者_如何学Python.g:
Error 711 error C2061: syntax error : identifier 'ceil' c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath 40
Error 712 error C2059: syntax error : ';' c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath 40
and then the same two errors just with another identifier.
I have Compile As C on under C/C++ -> Advanced, and all the files in the project are .c files.
<cmath>
is a C++ header file. It's probably being included by some other C++ header file. Looking at your code, I can see that you're including <string>
and <sstream>
, both of which are C++ header files.
//#include <unistd.h> // doesn't exist in vs2010?
unistd.h is a unix header
精彩评论