简体   繁体   English

没有调试就无法运行VC ++程序

[英]Cannot run VC++ program without debugging

I can run with debugging and I can run in release mode but I cannot run without debugging. 我可以运行调试,我可以在发布模式下运行,但我没有调试就无法运行。 I am pretty sure I messed up the configuration in visual studio somewhere but I am not sure. 我很确定我搞砸了Visual Studio中的配置,但我不确定。 The computer was frozen I may have inadvertently clicked something. 计算机被冻结我可能无意中点击了某些东西。 It normally works. 它通常有效。 Does anybody have any ideas? 有人有什么想法吗? Thank you! 谢谢!

EDIT: The program works with F5. 编辑:该程序适用于F5。 It also works when I put the configuration to Release and run the executable. 当我将配置放到Release并运行可执行文件时,它也可以工作。 However Ctrl + F5 does not work, and the executable it creates does not work either. 但是Ctrl + F5不起作用,它创建的可执行文件也不起作用。

I just get an error saying windows is looking for a solution and then this: 我只是得到一个错误,说Windows正在寻找解决方案然后这个: 替代文字

I even tried getting the entire solution from source safe with the same results... 我甚至尝试从源安全的整个解决方案获得相同的结果...

EDIT 2: After following the windbg advice given to me below, I arrived at this error: 编辑2:在按照下面给出的windbg建议后,我得出了这个错误:

*** ERROR: Symbol file could not be found.  Defaulted to export symbols for mfc71d.dll -

My guess is that you have some undefined behavior in your program, such as uninitialized variables. 我的猜测是你的程序中有一些未定义的行为,比如未初始化的变量。 In debugging mode this doesn't cause a crash because the debugging versions do things like initialize memory for you and don't do any sort of optimization. 在调试模式下,这不会导致崩溃,因为调试版本会执行诸如为您初始化内存而不执行任何优化的操作。

Check for wild pointer mistakes, and check for uninitialized memory problems. 检查Wild指针错误,并检查未初始化的内存问题。 And turn up the warning level on the C++ compiler to level 4 (the highest practical level). 并将C ++编译器上的警告级别调高到4级(最高实际级别)。 That should help you catch these kinds of mistakes. 这应该可以帮助你捕捉到这些错误。

It looks like the program crashed. 看起来程序崩溃了。 It also looks like that GUI is pointing you at a crash dump. 看起来GUI也指向崩溃转储。 Here's how to inspect the dump. 以下是检查转储的方法。

Download " Debugging tools for Windows " from Microsoft. 从Microsoft下载“ Windows调试工具 ”。 Install it. 安装它。

Then run, from a command prompt: 然后从命令提示符运行:

> cd \Program Files\Debugging Tools for Windows (x64) [or possibly without (x64)]
> windbg -z C:\users\ntsoiasue\appdata\local\temp\wer3f91.tmp.mdmp

When windbg starts, it will give you a command prompt... 当windbg启动时,它会给你一个命令提示符......

Type the following into that command prompt: 在该命令提示符中键入以下内容:

> .sympath+ [path to your VS output folder (eg. "Release").
             That is, somewhere with a .pdb file for your binary]
> .reload -f [name of your binary]
> k

This will give you a stack trace of the crash. 这将为您提供崩溃的堆栈跟踪。

By the way. 顺便说说。 Windbg is a pretty good tool and worth getting to know. Windbg是一个非常好的工具,值得了解。

It happened with me also. 它也发生在我身上。 I had to do a full uninstall of vc++. 我不得不完全卸载vc ++。 Reboot your machine and install again.It worked for me. 重新启动机器并重新安装。它对我有用。

Have you tried doing a full rebuild? 你尝试过完全重建吗? Maybe manually removing all intermediate and output files? 也许手动删除所有中间和输出文件?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM