You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

a.out: cannot execute binary file

Hello

I've tried to compile gcc4 on an old g4 (Mac OS X 10.3) to be able to build universal binaries.
(I followed the instructions on http://biolpc22.york.ac.uk/pub/linux-mac-cross/)
I can compile stuff for ppc, but when I compile with "-arch i686" and run the app, after moving the binaries to my intel mac, it returns "./a.out: cannot execute binary file".
Something strange (IMO): when i compile every .c file with "gcc4 -c xx.c", move them to my intel mac and link them there, it runs without problems.

What can cause this problem?
Bye

Posted on Mar 31, 2008 5:00 AM

Reply
9 replies

Mar 31, 2008 6:45 PM in response to vortexfive

vortexfive wrote:
Something strange (IMO): when i compile every .c file with "gcc4 -c xx.c", move them to my intel mac and link them there, it runs without problems.


Hmm. That sounds like a good clue to look at. You need to be able to link to the Intel libraries on your G4 and it may not be doing that. I looked at the link you posted and it's quite frankly well beyond me. But I'd say you need to look at where the binaries are being linked and make sure they're linking to the Universal Mac OS 10.4 SDK libraries and not the 10.3 ones. But exactly how you'd do that, I'm not sure...

charlie

a.out: cannot execute binary file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.