必须用XCode编译几次
我正在 XCode 3.2.6 中使用 C++ 编写音频应用程序。通常,在对代码进行更改或添加后,我必须编译 3 或 4 次才能使程序正常运行。每次,它编译时都没有编译器错误,但要么是声音故障,要么是我遇到随机运行时错误,或者只是崩溃。如果我编译 3 或 4 次而不对代码进行任何更改,那么它就会运行良好,并且我永远不会遇到任何问题(直到我稍后对代码进行更多更改)。这种情况并不是每次我进行更改或添加时都会发生,但经常足以让我想把计算机扔出窗外。
还有其他人遇到这个问题吗?
I'm programming an audio app in XCode 3.2.6, using C++. Often, after making changes or additions to the code, I have to compile 3 or 4 times before the program runs ok. Each time, it compiles with no compiler errors, but either the sound glitches, or I get random runtime errors, or it just crashes. If I compile 3 or 4 times without making any changes to the code, it then runs fine, and i never run into any problems (until I make more changes to the code later on). This doesn't happen every time I make changes or additions, but often enough to make me want to throw my computer out the window.
Anyone else experience this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是编译器错误,而是您正在编译的代码中的错误。
任何有时运行正常有时运行不正常的程序都在使用未初始化的存储。这些初始化的变量在运行时边界检查未激活的代码部分中用作内存引用或数组下标。这是 C 中经常出现的问题,在 C++ 中也会出现。
如果您对音频应用程序进行了编程,则错误将出在您的代码中。当失败时,你需要进行详细的调试,然后你会发现未初始化的存储。
任何有经验的程序员都应该知道程序中随机错误的原因和解决方法。
Its not a compiler fault, but a fault in the code you are compiling.
Any program that sometimes runs OK and sometimes does not is using uninitialised store. These initialised variables are either used as memory references or array subscripts in parts of the code where runtime bound checking is not active. This is frequently a problem in C and also occurs in C++.
A you programmed the Audio app, the fault will be in you code. When it fails you need to do detailed debugging and then you will find the uninitialised store.
Any experienced programmer should be aware what are the causes and cures of random faults in programs.