Visual c++ 2010 express edition compiler problem

I'm trying to compile the following code using visual c++ express edition that I downloaded for free. I get a ton of errors when I compile. I just listed some of them. I did exactly what they said for creating a project and c file. Is there something wrong with this free version or did I screw up.

/ my first program in C++

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}

1>------ Build started: Project: trialrun3, Configuration: Debug Win32 ------
1> my3rdprogram.c
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2061: syntax error : identifier 'acosf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2061: syntax error : identifier 'asinf'
Last edited on
Is this line actually part of your code:
/ my first program in C++

If so, make sure the line begins with a double "//" not just one.

If that isn't the problem, then there might be something wrong with the way the compiler was installed.
It was a cut and past error I had 2 quotes. I'm going to try and re-download the compiler.

Thanks
I re-downloaded it and now it works. I also used the .cpp extension and not the .c extension.

Thanks
Wow, I overlooked that. Most compilers will switch between C and C++ based upon the extension of the file. .c and .cpp was very likely the real problem.
But so long as it works now...
Topic archived. No new replies allowed.