无法运行VC++程序无需调试

发布于 2024-10-09 08:30:52 字数 501 浏览 4 评论 0原文

我可以在调试模式下运行,也可以在发布模式下运行,但如果没有调试就无法运行。我很确定我搞乱了 Visual Studio 中某处的配置,但我不确定。电脑死机了 我可能无意中点击了某些东西。它通常有效。有人有什么想法吗?谢谢你!

编辑: 该程序与 F5 配合使用。当我将配置放入发布并运行可执行文件时,它也可以工作。但是 Ctrl + F5 不起作用,它创建的可执行文件也不起作用。

我刚刚收到一条错误消息,说 Windows 正在寻找解决方案,然后是: alt text

我什至尝试从源安全处获取整个解决方案,结果相同......

编辑2: 在遵循下面给我的windbg建议后,我遇到了这个错误:

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

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. 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. It also works when I put the configuration to Release and run the executable. However Ctrl + F5 does not work, and the executable it creates does not work either.

I just get an error saying windows is looking for a solution and then this:
alt text

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:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

温馨耳语 2024-10-16 08:30:52

我的猜测是您的程序中有一些未定义的行为,例如未初始化的变量。在调试模式下,这不会导致崩溃,因为调试版本会为您执行诸如初始化内存之类的操作,并且不会执行任何类型的优化。

检查是否存在野指针错误,并检查是否存在未初始化的内存问题。并将C++编译器的警告级别调至4级(最高实用级别)。这应该可以帮助您发现此类错误。

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. And turn up the warning level on the C++ compiler to level 4 (the highest practical level). That should help you catch these kinds of mistakes.

神也荒唐 2024-10-16 08:30:52

看起来程序崩溃了。 GUI 看起来也将您指向故障转储。以下是检查转储的方法。

下载“Windows 调试工具”微软。安装它。

然后从命令提示符处运行:

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

当 Windbg 启动时,它将给您一个命令提示符...

在该命令提示符中键入以下内容:

> .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

这将为您提供崩溃的堆栈跟踪。

顺便一提。 Windbg 是一个非常好的工具,值得了解。

It looks like the program crashed. It also looks like that GUI is pointing you at a crash dump. Here's how to inspect the dump.

Download "Debugging tools for Windows" from Microsoft. 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...

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.

糖粟与秋泊 2024-10-16 08:30:52

您是否尝试过完全重建?也许手动删除所有中间和输出文件?

Have you tried doing a full rebuild? Maybe manually removing all intermediate and output files?

转身以后 2024-10-16 08:30:52

我也发生过这种情况。我必须完全卸载 vc++。重新启动机器并再次安装。它对我有用。

It happened with me also. I had to do a full uninstall of vc++. Reboot your machine and install again.It worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文