问题
I just reinstalled Windows on my machine. Before that, I was using the Eclipse CDT IDE
for Windows (64-bit) with MinGW compiler suite (downloaded using mingw-get). Everything worked perfectly fine before the reinstall.
After the installation I tried to compile and run my C++ projects, but I always got the terminated, exit value: <some number>
error in the console, even for a Hello World!
project. I also got an error saying the libgcc_s_dw2-1.dll
is missing from my computer when I tried to run the executable from the command line.
So I uninstalled MinGW and tried again and it did not work. I completely removed anything related to MinGW from my system, I removed Eclipse, deleted every workspace, cleaned everything (or at least I think). Then I created a fresh Eclipse
folder, then installed the MinGW
and created path variables. Everything looked like they have been reset and now when I try to compile and run anything, the compilations seems to work fine but running the executable is still not possible. I still get the same error on every launch. Cleaning the project did not work either. I tried several other workarounds both from Stack Overflow and other sources but they did not work for me either and I am clueless at this point and stuck.
I would really appreciate any help regarding this problem. Thanks!
回答1:
sounds like you did not properly add the mingw/bin folder to your PATH variable. libgcc_s_dw2-1.dll should be in there.
compiling should work, because eclipse autodetects your mingw installation. but when you try to run your program it just searches the PATH variable and it´s own directory for the dll and fails to find it
回答2:
The missing libgcc_s_dw2-1.dll is a telltale sign of a different, and possibly wrong (mismatched pieces?) MinGW installation (or of CDT failing at its autodetection tricks).
I suggest compiling something simple from the command line and then something less simple with Make to validate the MinGW installation before involving Eclipse CDT.
来源:https://stackoverflow.com/questions/18082736/eclipse-cdt-fails-to-run-compiled-executable-in-windows-with-error-terminated