[英]How do you run a C++ code in Windows Visual Express?
I am just starting to learn the C++ language and I have recently come across a problem. 我刚刚开始学习C ++语言,最近遇到了一个问题。 The book that I bought told me how to compile a program but it didn't tell me how to run it.
我买的书告诉我如何编译程序,但没有告诉我如何运行程序。 When I try to run it using the debugger, this is what comes up:
当我尝试使用调试器运行它时,结果如下:
'Hello.exe' (Win32): Loaded 'C:\\Windows\\SysWOW64\\KernelBase.dll'. 'Hello.exe'(Win32):已加载'C:\\ Windows \\ SysWOW64 \\ KernelBase.dll'。 Cannot find or open the PDB file.
找不到或打开PDB文件。 'Hello.exe' (Win32): Loaded 'C:\\ProgramData\\Norton{0C55C096-0F1D-4F28-AAA2-85EF591126E7}\\N360_20.3.0.36\\Definitions\\BASHDefs\\20131022.001\\UMEngx86.dll'.
'Hello.exe'(Win32):已加载'C:\\ ProgramData \\ Norton {0C55C096-0F1D-4F28-AAA2-85EF591126E7} \\ N360_20.3.0.36 \\ Definitions \\ BASHDefs \\ 20131022.001 \\ UMEngx86.dll'。 Cannot find or open the PDB file.
找不到或打开PDB文件。 'Hello.exe' (Win32): Loaded 'C:\\Windows\\SysWOW64\\msvcp120d.dll'.
'Hello.exe'(Win32):已加载'C:\\ Windows \\ SysWOW64 \\ msvcp120d.dll'。 Cannot find or open the PDB file.
找不到或打开PDB文件。 'Hello.exe' (Win32): Loaded 'C:\\Windows\\SysWOW64\\msvcr120d.dll'.
'Hello.exe'(Win32):已加载'C:\\ Windows \\ SysWOW64 \\ msvcr120d.dll'。 Cannot find or open the PDB file.
找不到或打开PDB文件。 The thread 0x1748 has exited with code 0 (0x0).
线程0x1748已退出,代码为0(0x0)。 The program '[648] Hello.exe' has exited with code 0 (0x0).
程序“ [648] Hello.exe”已退出,代码为0(0x0)。 ter code here`
这里的ter代码`
Can somebody please tell me what I am doing wrong? 有人可以告诉我我做错了吗? By the way this is what comes up at the bottom of the page where output should be.
顺便说一句,这就是页面底部应该输出的内容。
Try using a pause fragment before the end of main()
. 尝试在
main()
结束之前使用暂停片段。
std::cout << "Paused. Press ENTER to continue.\n";
std::cin.ignore(100000, '\n');
or placing a breakpoint at the end of main()
. 或在
main()
的末尾放置一个断点。
I suggest using "Rebuild all" option to make the PDB warnings go away. 我建议使用“全部重建”选项使PDB警告消失。 Another solution is to manually open the folder and delete them then rebuild.
另一个解决方案是手动打开文件夹并删除它们,然后重新生成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.