Question

After upgraded to Snow Leopard, I can no longer run Eclipse CDT project on my computer. While the build process completes without any error, Eclipse does not recognize the binary file it created. When try to point to the binary file in Run Configuration.. dialog, it cannot find any binary in the project. Though executing the file from Terminal works fine.

According to a post at on Eclipse forum, this might be a problem that Mach-O parser does not recognize 64-bit binaries. Does anyone know what are the solutions or workarounds to the problem so that I can run/debug my C++ projects on Snow Leopard.

UPDATED

The solution suggested by Shane, though allowing the binary created to be recognized, does introduce another problem. Since system libraries in Snow Leopard are all 64 bits, it is no longer possible to link the code created with -arch i386 with these libraries, and hence not a feasible solution yet.

Was it helpful?

Solution

As per the post you referenced, you need to add -arch i386 to the compiler and linker settings for the project. Then when you rebuild the project, CDT picks up the executibles.

Project Properties -> C/C++ Build -> Settings. Then in compiler and linker Miscellaneous sections add the flag in Other flags.

Cheers,

OTHER TIPS

As Eclipse's binary parser has not been updated to recognized the new 64-bit Mach-O binary format (https://bugs.eclipse.org/bugs/show_bug.cgi?id=270790), it looks like the only workaround now is to compile code in 32-bit mode.

The consequence is that it is not possible to link C/C++ project to any system libraries since most of them are compiled as 64-bit already.

My solution for now is temporary switching to XCode.

gmatt,

The 64 binaries are different as the new architecture has new general purpose registers as well. There are also more differences in the architectures that would affect the opcodes you will see in the binary.

Cheers, Shane

A new Mach 64 bit binary parser has finally been released.

I just did an update in Eclipse and under project properties selected the new binary parser. I can finally run my c++ binaries from within Eclipse, but I am still struggling with debugging for some reason.

As I know before, binary parser is located [Project Properties -> C/C++ Build -> Settings] as told above. but I think it's changed.

I could found binary parsers through this way: [eclipse -> environment -> C/C++ -> New C/C++ Project Wizard -> makefile project -> binary parsers -> mach-O parser (Deprecated)]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top