Whats wrong with my code?

Feb 16, 2011 at 11:46pm
Whats wrong with my code?

#include <iostream>
using namespace std;

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

I keep on getting two errors:

"there were build errors. Would you like to continue and run the last succesful build?"

And

"Unable to start program. The system cannot find the filed specified."

I've already installed visual studio express twice. But it just keeps on giving me the same errors.
Feb 16, 2011 at 11:50pm
You might want to do a clean then rebuild.
Feb 17, 2011 at 8:52am
closed account (z05DSL3A)
My guess is that you created a project, deleted the code given by the project template and replaced it with the above. If the is a correct assumption it is likely that you have removed the include file used for pre-compiled headers. The easiest way to check this is to put #include <stdafx.h> on the the top line of your code and rebuild.

If this does not work, instead of saying yes to the "there were build errors... " dialog, say no and go back to VS, click on the error list tab at the bottom and report back here what the errors are.
Feb 17, 2011 at 2:43pm
Your code as perfect. Try compile in other compiler, for example: g++ or mingW.
Feb 18, 2011 at 11:01pm
Thanks Grey Wolf :)
Topic archived. No new replies allowed.