簡體   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”

我是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 Server。 下次調試時,它將加載許多系統符號(警告:調試器似乎已掛起,但正在下載,請耐心等待)。 然后將它們緩存下一次。 現在,您將獲得完整的通話堆棧。

只是開個玩笑:您看到的輸出是Visual Studio無法找到這些模塊的“符號數據庫”。 Visual Studio使用它們自己的格式

在調試代碼時會使用符號,通常無法找到那些不是您自己編寫的模塊的符號,或者是無法像操作系統提供的那樣以“常規方式”進行調試的符號。

如果您看一下第一行:您的程序已加載了符號,這意味着您將能夠將源代碼行和構造與機器將執行的內容相關聯(這將對確定正在解釋的內容非常有用)如果遇到錯誤,則錯誤)。

您不必擔心其他模塊沒有符號。

小提示:通常有兩種(或更多)編譯模式

  • 調試
  • 發布

第一種表示“用調試符號生成可執行文件”,而將產生很少的優化(因此也較慢)的更大的可執行文件,第二種表示“不生成調試符號,只是使程序快而小。”將其部署到最終最終用戶”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM