0

I am currently enrolled in a programming fundamentals class in c++. I've set up Visual Studio 2017 and am trying to run the example code from the textbook. Whenever I try to debug anything, including the sample "hello world" code, I get these errors.

I've tried changing the location of the project and triple-checked the code.

#include "pch.h"
#include <iostream>

int main()
{
    std::cout << "Hello World!\n"; 
}

It is supposed to output "hello world", but I get these errors instead.

'ConsoleApplication6.exe' (Win32): Loaded 'C:\Users\Asher\source\repos\ConsoleApplication6\Debug\ConsoleApplication6.exe'. Symbols loaded.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\apphelp.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ucrtbased.dll'
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
The thread 0x358c has exited with code 0 (0x0).
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'ConsoleApplication6.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
The thread 0x31c8 has exited with code 0 (0x0).
The thread 0xca8 has exited with code 0 (0x0).
The thread 0x27a4 has exited with code 0 (0x0).
The program '[20724] ConsoleApplication6.exe' has exited with code 0 (0x0).
Thomas Matthews
  • 56,849
  • 17
  • 98
  • 154
  • BTW, I highly recommend not using precompiled headers, e.g. `pch.h` until you are confident in writing large programs. The benefit is negligible for small programs. – Thomas Matthews Oct 02 '19 at 18:12
  • 1
    Most of those are warnings indicating that the debug symbols for the DLLs could not be found. You can still debug your program; you want be able to expand into any of the DLL functions (which are not often required). – Thomas Matthews Oct 02 '19 at 18:14
  • 1
    There should be a duplicate of this ... – Thomas Matthews Oct 02 '19 at 18:14
  • There seems not to be any error. I think your program runs, outputs its text into the console window (which you probably missed, since its very fast), and then instantly exits. Try to set a breakpoint (F9) before starting your debug session. You should add a `return 0;` in `int main()` body anyway. – user2328447 Oct 02 '19 at 18:20
  • https://stackoverflow.com/a/15817925/2328447 and https://stackoverflow.com/a/54084067/2328447 might be interesting for you. – user2328447 Oct 02 '19 at 18:31
  • @user2328447 `return 0;` is implicit in `main`, otherwise I second your comment. – Quentin Oct 03 '19 at 11:43

1 Answers1

0

PDB file is a debug information file used by Visual Studio. These are system DLLs, which you don't have debug symbols for. Go to Tools->Options->Debugging->Symbols and select checkbox "Microsoft Symbol Servers", Visual Studio will download PDB files automatically.

enter image description here

Jeaninez - MSFT
  • 3,210
  • 1
  • 5
  • 20