gpt4 book ai didi

c++ - 在 Visual Studio 中使用本地 Windows 调试器运行第一个程序。输出窗口显示无数个 "Cannot find or open the PDB file"

转载 作者:行者123 更新时间:2023-11-27 23:06:03 30 4
gpt4 key购买 nike

我对 C++ 是全新的,当我运行我的程序时,我在输出窗口中收到一堆输出,看起来像这样(抱歉它有多长)。我的简单程序运行正常,但是当我编写更高级的 C++ 程序时,这会成为问题吗?更重要的是,我该如何解决这个问题?谢谢。这是输出:

'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.

还有我简陋的程序:

#include <iostream>
#include <string>

using namespace std;

int main()
{
string name;

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

return 0;
}

最佳答案

补充一下@Marco 已经写的,你看到的警告是因为 visual studio 看不到系统 dll 的调试信息(“符号”)。一般来说,这不应该影响您的日常开发,但有时获取额外信息非常有用,例如,如果您必须修复系统代码中发生的崩溃(例如,如果您通过无效的参数或者如果你有一个双删除)。如果你没有这些符号,那么你会在调用堆栈中看到类似这样的内容:

> 0x267823af
0x27658abc
0x36726812
MyBrokenFunction()

然而,在 Visual Studio 2010 及更高版本中有一个非常有用的选项,您可以在其中打开 Tools -> Options -> Debugging -> Symbols 并勾选使用 Microsoft Symbol Servers 的选项。下次调试时,它将加载大量系统符号(警告:调试器看起来好像挂起,但它正在下载,所以请耐心等待)。然后将这些缓存起来以供下次使用。您现在将获得完整的调用堆栈。

关于c++ - 在 Visual Studio 中使用本地 Windows 调试器运行第一个程序。输出窗口显示无数个 "Cannot find or open the PDB file",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23503402/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com