每当我调试时出现几个错误
Posted
技术标签:
【中文标题】每当我调试时出现几个错误【英文标题】:Several errors appearing whenever I debug 【发布时间】:2019-10-02 18:11:11 【问题描述】:我目前正在参加 C++ 编程基础课程。我已经设置了 Visual Studio 2017 并尝试运行教科书中的示例代码。每当我尝试调试任何东西(包括示例“hello world”代码)时,都会收到这些错误。
我已尝试更改项目的位置并三重检查代码。
#include "pch.h"
#include <iostream>
int main()
std::cout << "Hello World!\n";
它应该输出“hello world”,但我得到了这些错误。
'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).
【问题讨论】:
顺便说一句,我强烈建议不要使用预编译的头文件,例如pch.h
直到您有信心编写大型程序。对于小程序来说,好处可以忽略不计。
其中大部分是警告,表明无法找到 DLL 的调试符号。你仍然可以调试你的程序;您希望能够扩展到任何 DLL 函数(通常不需要)。
应该有一个副本...
似乎没有任何错误。我认为您的程序运行,将其文本输出到控制台窗口(您可能错过了,因为它非常快),然后立即退出。在开始调试会话之前尝试设置断点 (F9)。无论如何,您都应该在 int main()
正文中添加 return 0;
。
***.com/a/15817925/2328447 和 ***.com/a/54084067/2328447 可能对您来说很有趣。
【参考方案1】:
PDB 文件是 Visual Studio 使用的调试信息文件。这些是系统 DLL,您没有调试符号。转到 Tools->Options->Debugging->Symbols 并选中“Microsoft Symbol Servers”复选框,Visual Studio 将自动下载 PDB 文件。
【讨论】:
以上是关于每当我调试时出现几个错误的主要内容,如果未能解决你的问题,请参考以下文章
尝试使用 python 3 运行 Spark 时出现几个错误