4

I have an xcode Objective-C iPhone static library project. When I build it in xcode I get no errors or warnings. But when I build it using xcodebuild from the command line I get:

"/Developer/usr/bin/gcc" -v -dM -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk -E -arch armv6 -o - -x objective-c /dev/null
gcc-4.2: error trying to exec '/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1': execvp: No such file or directory

I cannot find anything that helps me to understand what the issue is, any ideas?

And yes the /Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 file does exist :-)

3
  • You should probably post the xcodebuild command line too, so that we can see the arguments etc that you are passing to it. Commented Jun 5, 2010 at 9:06
  • I had it in a command shell target in xcode. I've just tried it from a command shell and it didn't produce the error. So I think it's something to do with running it from within Xcode. Commented Jun 5, 2010 at 9:09
  • Nope, getting it in xcode as well now. Oh hang a sec, now it's gone, GRRR! Commented Jun 6, 2010 at 10:25

1 Answer 1

3

For some reason what seemed to fix this for me is actually passing in the architectures to be used.

For instance, this command fails:

/Developer-SDK4/usr/bin/xcodebuild -target ProjectName -configuration Release build PLATFORM_NAME=iphonesimulator BUILDSDK=/Developer-SDK4

But this one works:

/Developer-SDK4/usr/bin/xcodebuild -target ProjectName -configuration Release build PLATFORM_NAME=iphonesimulator BUILDSDK=/Developer-SDK4 ARCHS=i386

Note, this only failed for me when building against the simulator. Building against the device seemed to work just fine.

Sign up to request clarification or add additional context in comments.

3 Comments

For the record, I had also tried the steps outlined in these pages: openradar.appspot.com/7338181 stackoverflow.com/questions/1598502/…
Tried adding the architectures, but no luck. Still getting the errors even though everything works.
Adding ARCHS=x86_64 worked for me in 2023, seems like this question is older, but it still lead me to the solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.