Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cruxyl

macrumors newbie
Original poster
Feb 21, 2011
3
0
I am running OSX 10.6.6 with xcode 3.2.4. I have been creating c++ source and compiling it with g++ on this machine (successfully) for several months. I haven't compiled anything for a week or two until today; when I tried to execute the binary (which compiled fine), I get a "Malformed Mach-o file" message. I compiled several other source files (that had previously compiled and executed fine) and they also failed with the Malformed message. Binaries that I'd previously compiled continue to execute fine.

lipo -info on the (nix) binary returns this message ...

Non-fat file: nix is architecture: x86_64

What's the problem and how do I resolve it?
 
I dont know, but perhaps try the following.

Try to compile and run the simplest of hello world C++ programs. Try to compile and run the simplest of hello world C programs.

Confirm the path of g++ with "which g++". Do you have any cross-compilers installed? What happens if instead of g++ you explicitly use "/usr/bin/g++".

Try completely removing Xcode with "sudo /Developer/Library/uninstall-devtools --mode=all" and reinstalling Xcode.
 
Thanks. Compiled a helloworld.c pgm and got same error.
Which g++ -> /usr/bin/g++.
I'm going to uninstall Xcode and install Xcode 3.2.5.
 
Fixed. Problem in a script that set the "-c" option on the GCC compiler. This script worked previously; so the behavior must have changed ...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.