0

this is my code very simple just for a test.

 #include <iostream>

 using namespace std;
 int main()
 {
 int a, b, c;
 a = 2;
 b = 7;
 c = a + b * 3;
 cout << c;
 return 0;
 }

I get this debug 'test.exe' (Win32): Loaded 'C:\Users\Jacob\Documents\Visual Studio 2017\Projects\test\Debug\test.exe'. Symbols loaded. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\ntdll.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\kernel32.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Unloaded 'C:\Windows\syswow64\kernel32.dll' 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\kernel32.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\KernelBase.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\msvcp140d.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\vcruntime140d.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\vcruntime140d.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Unloaded 'C:\Windows\syswow64\vcruntime140d.dll' 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\ucrtbased.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\ucrtbased.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Unloaded 'C:\Windows\syswow64\ucrtbased.dll' 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\ucrtbased.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Unloaded 'C:\Windows\syswow64\ucrtbased.dll' 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\kernel.appcore.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\msvcrt.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\rpcrt4.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\sspicli.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\cryptbase.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\bcryptprimitives.dll'. Cannot find or open the PDB file. 'test.exe' (Win32): Loaded 'C:\Windows\syswow64\sechost.dll'. Cannot find or open the PDB file. The thread 0x128 has exited with code 0 (0x0). The thread 0x1f08 has exited with code 0 (0x0). The thread 0x15d0 has exited with code 0 (0x0). The program '[1976] test.exe' has exited with code 0 (0x0).

  • 1
    Put a breakpoint on the line `return 0`. – Mark Ransom May 24 '17 at 03:00
  • This just means you haven't installed debug versions of the mentioned libraries; don't worry, the final line `The program '[1976] test.exe' has exited with code 0 (0x0).` shows everything completed correctly. Oh, and add `getchar();` before the `return 0;` so that the window doesn't close immediately. – Ken Y-N May 24 '17 at 03:05

1 Answers1

1

The classic C/C++ style program you've created with a main() function and no windowing calls or libraries is called a console program in WIndows. That means it's meant to be run from within a console window; the standard input and output will occur within that console window.

If you don't have a console window, Windows will create one for you when the program starts. However it will destroy it immediately when the program ends.

There are many techniques for getting around this. First is to start the program from a console that you've already opened - Windows won't close it if it didn't open it automatically. But that doesn't work if you're trying to use the debugger. Second is to make the program pause at the end before it exits. You can do this by reading something from cin or as I suggested in the comments just put a breakpoint at the end of the program.

The messages you see in the Visual Studio output window are not the output of your program, they are debugging messages generated by Windows itself or the C++ runtime. The ones you see about missing PDB files are completely harmless, they mean that you don't have debugging information for the DLLs supplied by Windows which is perfectly normal.

Mark Ransom
  • 299,747
  • 42
  • 398
  • 622