简体   繁体   English

如何在Windows Visual Express中运行C ++代码?

[英]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.

相关问题 如何在Visual Studio中预览C ++代码 - How do you preview your c++ code in visual studio C ++:如何在使用libcurl的Windows中运行可执行文件? - C++: How do you run an executable in windows that uses libcurl? 你如何在 alpine linux 上运行和编译 C++ 代码? - How do you run and compile C++ code on alpine linux? 如何在 microsoft visual studios express 2013 for windows 桌面上运行 c++ 程序? - How to run c++ program on microsoft visual studios express 2013 for windows desktop? 如何在 Visual Studio C++ 速成版中启用自动完成功能? - How do you enable auto-complete functionality in Visual Studio C++ express edition? 在Visual C ++ Express中构建C代码 - Building C code in Visual C++ Express 如何使用Visual C ++在Windows上构建通用数学模板库 - How do you build the Generic Math Template Library on Windows with Visual C++ 使用Visual Studios 2012进行C ++编码时,如何自动完成在IntelliSense中选择的代码? - When using Visual Studios 2012 for coding in C++, how do you autocomplete code selected in IntelliSense? 如何在 VS - Code (Windows) 中同时编译和运行我的 C++ 代码 - How do I compile and run my c++ code at the same time in VS - Code (Windows) 如何在Visual Studio代码中构建和运行C ++代码? - How to build and run C++ code in Visual Studio Code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM