views:

187

answers:

2

The following code in microsoft visual C++ 2010 express:

#include <iostream>
//using namespace std;

int main(int argc, char **argv)
{


 return(0);

}

gives me the errors:

1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\cmath(19): error C2061: syntax error : identifier 'acosf'
...
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\cmath(41): fatal error C1003: error count exceeds 100; stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

If comment out “#include ” then it compiles. I created an project from existing code and edited to the above.

A: 

I don't have the express edition installed, but I bet it's because you have commented out the using namespace std; snippet.

Though your code sample compiles just fine in VS 2008 prof edition.

C Johnson
A: 

Hello All. Sorry for my bad English.

I'd the same problem an was resolved with this configuration parameter:

  1. Tools bar -> Project -> Properties (or Alt + F7).
  2. Configuration Properties -> C/C++ -> Advanced.
  3. Compile As

If you have in "Compile As" field the value "Compile as C Code" then you must change it to Default or "Compile as C++ Code".

I hope I have been helpful

Best regards

Ko-Barde