Eclipse Oxygen启动报错:Binary not found问题求助(MinGW环境)
Hey there, let's work through this "Launch Failed: Binary not found" headache together—it’s a super common snag when using Eclipse Oxygen with MinGW, so we’ll get your project up and running in no time.
- Open Eclipse and go to
Window > Preferences > C/C++ > Build > Tool Chain Editor. Make sure the current toolchain is set to MinGW GCC—if it’s not, use the dropdown to select it. - Next, head to
C/C++ > Build > Environmentand verify that thePATHvariable includes your MinGWbindirectory (usually something likeC:\MinGW\bin). If it’s missing, click "New" to add it manually. - Also, fire up the MinGW Installation Manager and confirm that components like
mingw32-gcc-g++andmingw32-gdbare installed. If any are missing, check them and click "Apply Changes" to install/update.
Right-click your project and select Properties > C/C++ Build > Settings, then check these key areas:
- Under
Tool Settings > MinGW C++ Linker > Output, make sure the output file path is correct. It should look like${ProjDirPath}/Debug/[YourProjectName].exe—if it’s pointing to something else or missing the.exeextension, fix it here. - Verify that both
MinGW C CompilerandMinGW C++ Compilerhave their output directories set to theDebugfolder. This ensures the linker can find the.ofiles (like yourstringTest.o) to assemble the final executable. - Critical note: When you build the project, keep an eye on the Console tab! If there are compilation or linking errors (red text), Eclipse won’t generate the
.exefile at all. Common issues include undefined symbols, syntax errors, or missing libraries—fix these first, as they’re often the root cause.
- Right-click your project and go to
Run As > Run Configurations. Select your C/C++ Application entry:- In the
Maintab, confirm the correct project is selected, then forC/C++ Application, clickSearch Projectto find the.exein your Debug folder. If it doesn’t show up, manually enter the path (e.g.,${workspace_loc:/[YourProjectName]/Debug/[YourProjectName].exe}). - Switch to the
Environmenttab and ensure thePATHvariable includes your MinGWbindirectory. Without this, Eclipse might fail to find the necessary DLLs to run your program.
- In the
Old build cache can cause weird issues. Right-click your project, select Clean, choose Clean all projects, then click Build Project to rebuild everything. Check the Debug folder again after this—you should see your .exe file if all goes well.
If you created a Library project instead of an Executable project, Eclipse will only generate .a or .lib files, not an .exe. Double-check by right-clicking your project > Properties > Project Natures—it should have C++ Nature and be set up as an executable project (like Empty Project or Hello World Project from the new project wizard).
One last quick tip: Avoid spaces or Chinese characters in your project path or name. Eclipse can struggle with non-standard paths, so move your project to a simple location like C:\Projects\MyTestProject if needed.
内容的提问来源于stack exchange,提问作者Glorius

