Cygwin 编译错误:“此应用程序已请求运行时以不寻常的方式终止它”
我正在尝试运行 Cygwin,但遇到了一些问题。我试图用 mingw 编译一个既可以在 Windows 上运行也可以在 Unix 系统上运行的程序,但是当我通过 Cygwin 编译它时:
gcc threads.c -o threads
我收到错误: 这个应用程序已请求运行时以一种不寻常的方式终止它
就是这样......我忘记或搞砸了什么?我大约有 5 年没有碰过这些东西了,所以我已经生锈了。谢谢!
I am trying to run Cygwin, and I am running into some problems. I tried to compile a program that works both on Windows with mingw and on a Unix system, but when I go to compile it through Cygwin:
gcc threads.c -o threads
I get the error:
this application has requested the runtime to terminate it in an unusual way
And that's it... any ideas what I am forgetting or screwing up? I haven't touched this stuff in about 5 years so I am beyond rusty; thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
就我而言,这个问题是由于我没有在 cygwin 中定义 TEMP 环境变量而引起的,请尝试:
如果 TEMP 已定义,请确保该目录不是只读的。
In my case this problem was caused by the fact I didn't have a TEMP environment variable defined in cygwin, try:
If TEMP is already defined make sure the directory is not read only.
该错误消息意味着编译器在尝试构建程序时崩溃了。
这很可能意味着您的 Cygwin 安装已损坏或恰好包含损坏版本的 gcc。尝试更新到 Cygwin 的当前版本。鉴于 Cygwin 1.7 和 GCC 4 的第一个稳定版本都是最近才发布的,情况就更是如此。如果您仍在使用 Cygwin 1.5 或 GCC 3.x,我认为升级很有可能解决您的症状。
The error message means the compiler crashed while trying to build your program.
Most likely this means your Cygwin installation is corrupt or happens to include a broken version of gcc. Try updating to the current version of Cygwin. This is doubly the case given that Cygwin 1.7 and the first stable releases of GCC 4 are both recent happenings. If you're still on Cygwin 1.5 or GCC 3.x, I think there's an excellent chance that upgrading will fix your symptom.
假设您正在编译我收集的与线程有关的threads.c,您尝试过吗...
这告诉 gcc 编译器包含库线程并将其链接在一起。
或者...您可以将开关包含在上面的命令行
-mno-cygwin
中,如果您不需要类似 UNIX 的行为。
希望这有帮助,
此致,
汤姆.
Assuming you are compiling threads.c which I would gather has something to do with threads, have you tried this...
This is telling the
gcc
compiler to include the library threads and link it together.Or... you could include the switch into the above command line
-mno-cygwin
if youdon't need the unix-like behaviour.
Hope this helps,
Best regards,
Tom.