无法运行VC++程序无需调试
我可以在调试模式下运行,也可以在发布模式下运行,但如果没有调试就无法运行。我很确定我搞乱了 Visual Studio 中某处的配置,但我不确定。电脑死机了 我可能无意中点击了某些东西。它通常有效。有人有什么想法吗?谢谢你!
编辑: 该程序与 F5 配合使用。当我将配置放入发布并运行可执行文件时,它也可以工作。但是 Ctrl + F5 不起作用,它创建的可执行文件也不起作用。
我刚刚收到一条错误消息,说 Windows 正在寻找解决方案,然后是:
我什至尝试从源安全处获取整个解决方案,结果相同......
编辑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:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我的猜测是您的程序中有一些未定义的行为,例如未初始化的变量。在调试模式下,这不会导致崩溃,因为调试版本会为您执行诸如初始化内存之类的操作,并且不会执行任何类型的优化。
检查是否存在野指针错误,并检查是否存在未初始化的内存问题。并将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.
看起来程序崩溃了。 GUI 看起来也将您指向故障转储。以下是检查转储的方法。
下载“Windows 调试工具”微软。安装它。
然后从命令提示符处运行:
当 Windbg 启动时,它将给您一个命令提示符...
在该命令提示符中键入以下内容:
这将为您提供崩溃的堆栈跟踪。
顺便一提。 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:
When windbg starts, it will give you a command prompt...
Type the following into that command prompt:
This will give you a stack trace of the crash.
By the way. Windbg is a pretty good tool and worth getting to know.
您是否尝试过完全重建?也许手动删除所有中间和输出文件?
Have you tried doing a full rebuild? Maybe manually removing all intermediate and output files?
我也发生过这种情况。我必须完全卸载 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.