开发者

"Program is not a recognized executable" error in Eclipse

开发者 https://www.devze.com 2023-03-26 21:51 出处:网络
I\'m trying to debug a C++ programme in Eclipse Indigo. The project is using autotools/configure (and the respective plugin) as build system.

I'm trying to debug a C++ programme in Eclipse Indigo. The project is using autotools/configure (and the respective plugin) as build system.

After successful build I right-clicked on the binary in the project browser and chose "Debug As". Then I 开发者_Python百科used the file browser to select the binary. Clicking on "Debug" then opens a dialog which just says "program is not a recognized executable".

Any ideas?


I found the answer: the binary parsers configured in eclipse were the wrong ones. Adding the correct binary parser under Project --> Properties --> C/C++ Build --> Settings solves he problem.


If you're using libtool in your project, what looks like the binary may actually be a wrapper script used to set LD_LIBRARY_PATH and stuff like that before executing the real binary (which is stored in the .libs directory). This may be what causes Eclipse to fail, but I'm not sure how you should go about fixing that.

There seem to be a bit of documentation about Eclipse CDT and libtool on the internet which may have the infos you need though: http://www.freerdp.com/wiki/doku.php?id=eclipse#debug_configuration


From OSX snow leopard on, gcc seems to build 64 bit executables by default. And those won’t be recognized from Eclipse in return. To solve the error, you’ve got to explicitly set your architecture to i386.

Enter your project properties and add the command line option “-arch i386″ for each C++ Linker, C++ Compiler and C Compiler. After a clean build, you should be clear to debug again. In Linker options make sure to NOT set it up as -Xlinker option.

Original Source

0

精彩评论

暂无评论...
验证码 换一张
取 消