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!
In my case this problem was caused by the fact I didn't have a TEMP environment variable defined in cygwin, try:
export TEMP=/tmp
If TEMP is already defined make sure the directory is not read only.
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.
Assuming you are compiling threads.c which I would gather has something to do with threads, have you tried this...
gcc -L libthreads -o threads threads.c
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 you
don't need the unix-like behaviour.
Hope this helps, Best regards, Tom.
精彩评论