0

I am just starting to learn the C++ language and I have recently come across a problem. The book that I bought told me how to compile a program but it didn't tell me how to run it. When I try to run it using the debugger, this is what comes up:

'Hello.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file. 'Hello.exe' (Win32): Loaded 'C:\ProgramData\Norton{0C55C096-0F1D-4F28-AAA2-85EF591126E7}\N360_20.3.0.36\Definitions\BASHDefs\20131022.001\UMEngx86.dll'. Cannot find or open the PDB file. 'Hello.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Cannot find or open the PDB file. 'Hello.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Cannot find or open the PDB file. The thread 0x1748 has exited with code 0 (0x0). The program '[648] Hello.exe' has exited with code 0 (0x0). ter code here`

Can somebody please tell me what I am doing wrong? By the way this is what comes up at the bottom of the page where output should be.

Jake Chavis
  • 7
  • 1
  • 6
  • There's no error there - all those messages are quite normal, the PDB's don't matter for you and the program ran normally (exit code 0). What did you expect it to do? See [this answer](http://stackoverflow.com/a/15938020/2065121) for more info on those PDB messages. – Roger Rowland Nov 03 '13 at 18:01
  • Your program ran and exited. The PDB messages are of no interest. – ScottMcP-MVP Nov 03 '13 at 18:02
  • Well I am used to Java, where when I ran the program, it would actually show the output. – Jake Chavis Nov 03 '13 at 18:02
  • What type of program is it? If it's a console app, it probably flashed up a cmd window and exited - try running with CTRL+F5 instead. – Roger Rowland Nov 03 '13 at 18:04
  • You're right, it did pull up a cmd window, but I guess what my question is, where can I actually see my output? CTRL + F5 doesn't work for my computer. – Jake Chavis Nov 03 '13 at 18:07
  • 2
    From Visual Studio Debug menu, choose "Start without debugging" then the cmd window will pause after execution, or start cmd.exe and navigate to your folder where the .exe is and run it from there by just typing "hello.exe" – Roger Rowland Nov 03 '13 at 18:16

1 Answers1

0

Try using a pause fragment before the end of main().

std::cout << "Paused.  Press ENTER to continue.\n";
std::cin.ignore(100000, '\n');

or placing a breakpoint at the end of main().

I suggest using "Rebuild all" option to make the PDB warnings go away. Another solution is to manually open the folder and delete them then rebuild.

Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154