简体   繁体   中英

ran first program with local windows debugger in visual studio. Output window displays numerous “Cannot find or open the PDB file”

im completely new with c++, i am receiving a bunch of output in the output window when i run my program that looks like this(sorry for how long it is). My simple program runs ok, but will this be an issue as i program more advanced c++ programs? more importantly, how do i fix this? thanks. Heres the output:

'First Try.exe' (Win32): Loaded 'C:\Users\isaiah\C++\Isaiahs Programs\First Try\Debug\First Try.exe'. Symbols loaded.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WRusr.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\urlmon.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wininet.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleacc.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\secur32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msimg32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nsi.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\iertutil.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\userenv.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'First Try.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.

And my humble program:

#include <iostream>
#include <string> 

using namespace std;

int main()
{
string name;

cout<< "Enter your name: ";
cin >> name;
cout << "Hello " << name << endl;

return 0;
}

To add what @Marco has already written, the warnings you see are because visual studio can't see the debug information ('symbols') for system dlls. In general this shouldn't affect your day-to-day development, but sometimes it comes in very useful to be able to get the extra information, for instance if you have to fix a crash that occurs in system code (eg if you passed invalid parameters or if you have a double-delete). If you didn't have the symbols then you'd see something like this in the callstack:

> 0x267823af
  0x27658abc
  0x36726812
  MyBrokenFunction() 

There is however a very useful option in versions of Visual Studio 2010 and later, where you open Tools -> Options -> Debugging -> Symbols and tick the option to use the Microsoft Symbol Servers. Next time you debug it will load lots of the system symbols (be warned: it looks like the debugger is hanging, but it's downloading, so be patient). These are then cached for next time. You'll now get a full call stack.

Just joking: the output you're seeing is visual studio not being able to find a "symbol database" for those modules. Visual studio uses its own format for these .

Symbols are used when debugging code, it's normal not being able to find those for modules you didn't write yourself or that aren't meant to be debuggable in the "normal way" as the ones provided by the OS.

If you take a look at the first line: your program has the symbols loaded, that means you will be able to associate your source code lines and constructs with what the machine will be executing (and that will come in handy for determining what's being interpreted wrong if you encounter a bug).

You don't have to worry about the other modules not having symbols.

A small notice: there are usually two (or more) compilation modes

  • Debug
  • Release

the first means "generate the executable with debug symbols" and that will produce a bigger executable with few optimizations (thus also slower), the latter means "don't generate debug symbols, just make the program fast and small.. I'm going to deploy this to the final end-users".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM