ld: can't open output file for writing: a.out, errno=13 for architecture x86_64

While compiling a simple C programme, just to test the gcc compiler that comes with Xcode 4.1, I encountered the following error.


ld: can't open output file for writing: a.out, errno=13 for architecture x86_64


This got resolved by doing the following.


sudo bash

export ARCHFLAGS='-arch i386 -arch x86_64'


Then recompiling the code from within bash.


It appears that Xcode 4.x does no longer support non x86_64 architectures by default. Can somebody clearly explain this problem?

Xcode 4.2-OTHER, Mac OS X (10.7.1), Mac OS X (10.7.2)

Posted on Oct 18, 2011 1:42 AM

Reply

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

ld: can't open output file for writing: a.out, errno=13 for architecture x86_64

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