R – Eclipse CDT on Snow Leopard cannot find binaries

eclipseeclipse-cdtgccmacososx-snow-leopard

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.

Best Answer

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,