Error trying to build

When I try to build this:


// my first program in C++
#include <limits>
#include <iostream>
using namespace std;

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

//end code

It outputs this:


'N00b C++.exe': Loaded 'C:\Users\Pat\Documents\Visual Studio 2010\Projects\N00b C++\Debug\N00b C++.exe', Symbols loaded.
'N00b C++.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'N00b C++.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'N00b C++.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'N00b C++.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
The program '[7664] N00b C++.exe: Native' has exited with code 0 (0x0).

//end error

/* How do I fix this?*/
Btw if it makes a difference I'm using Microsoft Visual IDE
Are you sure the "error" comes from the compiler?

Actually, I don't see much errors here, because:
1. all the messages relate to the 'N00b C++.exe', which, I think, is your compiled executable. That means the build is ok.
2. the 'Cannot find ...' messages are more or less just warnings from the windows kernel. And the PDB file is not important to the exe at runtime.
3. the return code of the exe is 0, that means 'Thumbs Up'.

I think your program is ok but you probably run it directly from the IDE.
But this is a command line program so you don't see the actual output of it. What happens is, the program starts, writes "Hello World!" to STDOUT and returns so fast that you might not notice the command line window appear and disappear again.

Open a command prompt and go to the folder with your EXE. Run the program there and you should see the out output.
Topic archived. No new replies allowed.