C++ compiling error
Posted: Fri Dec 10, 2010 12:23 pm
I've been having problem compiling C++ with Microsoft Visual C++ 2010 Express Edition for a long time now.
Here's an example.
My code(Exactly the same as examples in the book):
And I get this error:
But when I use the Visual Studio command prompt to compile it, it works perfectly.
Is it something that is wrong with the software?
Here's an example.
My code(Exactly the same as examples in the book):
Code: Select all
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, I am your computer talking." << endl;
return 0;
}
Code: Select all
1>------ Build started: Project: Hello World!!, Configuration: Debug Win32 ------
1> Hello World!!.cpp
1>e:\cppprojects\helloworld\hello world!!\hello world!!.cpp(1): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>e:\cppprojects\helloworld\hello world!!\hello world!!.cpp(10): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Is it something that is wrong with the software?