本文介绍了在开发环境之外运行程序时程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我使用Visual C 2005来开发我的程序。其中一个特别是 在非常具体和难以复制的情况下崩溃,更糟糕的是因为它只会在运行时崩溃 - 开发 - 作为exe, 不是来自Debug选项。如果我尝试在 崩溃程序上启动调试,它将在调试器打开之前关闭。关于我应该如何进行的任何 建议?在此先感谢。 解决方案 哎呀,也许''具体''是一个坏词。我的意思是在一个不同的代码点上发生'取决于程序的编译方式'。 通常在fopen / fread操作的中间,但是当它不是吗?b $ b只是喜欢在任何地方碰撞。 1)您应该学习如何调试。第一条规则是: 阅读文档。 当发生崩溃时,您的编译器可以使用其调试器 。设置它,然后你 将找到崩溃的原因。 2)当你找到崩溃的源代码时,你可能会 注意到你正在经历bug的后果, 不是bug本身的直接原因。谨防快速 结论。 I use Visual C 2005 to develop my programs. One in particular iscrashing in very specific and hard to replicate situations, made worseby the fact it only crashes when run -outside- the dev - as an exe,not from the Debug option. If I try to launch the debug on thecrashing program, it''ll close before the debugger opens. Anysuggestions as to how I should proceed? Thanks in advance. 解决方案Oops, maybe ''specific'' was a bad word. I meant ''ocurring in adifferent point of code depending on how the program is compiled''.Usually in the middle of a fopen/fread operation, but when it isn''t itjust likes to crash anywhere it feels like.1) You should learn how to debug. The first rule is:READ THE DOCUMENTATION.Your compiler can spring into action with its debuggerwhen a crash occurs. Set it up to do that, and then youwill find the reason of the crash.2) When you find the source code of the crash you will probablynotice that you are experiencing the consequences of the bug,not a direct cause of the bug itself. Beware of quickconclusions. 这篇关于在开发环境之外运行程序时程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-21 11:21