简体   繁体   中英

error compiling C code in Eclipse

I am new to using Eclipse and CDT and have been trying to get my C code to compile. When I Run As Local C Application, it returns an error message Launch Failed. Binary Not Found Launch Failed. Binary Not Found . I have MinGW-w64 in C:\\mingw-w64. The program compiles and runs fine using gcc via cmd .

I would appreciate if eclipse-proficient users can help out with a how-to. Thanks!

Sometimes, if you try to launch first (before binary has been compiled) eclipse creates launch configuration automatically, that has no binary associated. Later even if you compiled your project (you do this using project/build or hammer icon), it will not associate binary automatically, as it tries to launch your old launch configuration. So:

  • make sure one of projects source files are selected (in editor for example)
  • click a down arrow next to bug icon
  • select debug configurations
  • select C/C++ application and click on "new launch configuration icon"
  • If C/C++ application field of your new launch configuration is empty, select search project or browse and tell it where your binary is
  • optionally set other launch/debug options
  • launch your new launch configuration using "Debug" button or from "bug" menu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM