Eclipse CDT fails to run compiled executable in Windows with error “terminated, exit value: <some number>”

时光总嘲笑我的痴心妄想 提交于 2019-12-11 21:22:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!