简体   繁体   English

在Visual Studio中使用本地Windows调试器运行了第一个程序。 输出窗口显示大量“找不到或打开PDB文件”

[英]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). 我是C ++的全新用户,当我运行如下所示的程序时,我在输出窗口中收到一堆输出(抱歉,持续了多长时间)。 My simple program runs ok, but will this be an issue as i program more advanced c++ programs? 我的简单程序运行正常,但是当我编写更高级的c ++程序时,这会成为问题吗? 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. 要添加@Marco已经编写的内容,您看到的警告是因为Visual Studio无法看到系统dll的调试信息(“符号”)。 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. 但是,在Visual Studio 2010和更高版本中,有一个非常有用的选项,您可以在其中打开“ Tools -> Options -> Debugging -> Symbols然后选中该选项以使用Microsoft Symbol Server。 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无法找到这些模块的“符号数据库”。 Visual studio uses its own format for these . Visual Studio使用它们自己的格式

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". 第一种表示“用调试符号生成可执行文件”,而将产生很少的优化(因此也较慢)的更大的可执行文件,第二种表示“不生成调试符号,只是使程序快而小。”将其部署到最终最终用户”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows 10中的Visual Studio 2012:找不到或打开PDB文件 - Visual Studio 2012 in Windows 10: Cannot find or open the PDB file 找不到或打开PDB文件Visual Studio 2012 - Cannot find or open the PDB file Visual studio 2012 在Visual Studio C ++ 2010中找不到或打开PDB文件 - Cannot find or open the PDB file in Visual Studio C++ 2010 视觉工作室。 无法启动程序 &#39;&#39; 系统找不到指定的文件 - Visual Studio. Unable to start program '' The system cannot find the file specified C ++ Microsoft Visual Studio 2015调试问题(无法找到或打开PDB文件。) - C++ Microsoft Visual Studio 2015 Debug issue (Cannot find or open the PDB file.) 如何修复“无法找到或打开 PDB 文件”。 在 Visual Studio 2017 中 - How to fix the "Cannot find or open the PDB file." in Visual Studio 2017 (C ++ / Visual Studio)无法找到或打开pdb文件且无法打印到控制台 - (C++/Visual Studio) cannot find or open pdb file & no printing to console Visual Studio找不到nafxcwd.pdb - Visual studio cannot find nafxcwd.pdb Visual Studio C ++-&gt;本地Windows调试器 - Visual Studio C++ -> Local Windows Debugger 从 Visual Studio 调试时找不到可执行文件旁边的文件。 当程序手动运行时,它确实 - Debugging from visual studio does not find file next to executable. When program ran manually, it does
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM