David26th
David26th

Reputation: 401

GCC-4.2 Failed with Exit Code 1 - Xcode

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

Hey all,

I've been working on a big update to my app that's involved a lot of coding (talking hundreds or thousands of lines here)

It's all been going really smoothly up until the latest code inset, I've added some code, that is in essence, the same as what's already in there with minor differences (a simple integer change from 77 to 78) and since then every time I try to build the code I get the above error message - now obviously it's not particulary helpful, any chance anyone can offer some good advice on this?

Edit as requested.

    {standard input}:1580:branch out of range
{standard input}:1566:branch out of range
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

Now there's several more of the standard input's but I figured there was no need to paste all of them.

Upvotes: 0

Views: 2037

Answers (4)

JanB
JanB

Reputation: 914

I recently had the same problem when I upgraded to Lion & xcode 4 on a new mac. I transferred my project over and the build failed with the error reported here. In my case, when I looked in the Build Phases/Compile Sources page, 3 of my files were shown in red indicating they hadn't been imported correctly. I removed the references and re-added the files to the project and it compiled fine.

Upvotes: 0

Rajat
Rajat

Reputation: 314

Search for "Compile for Thumb" option in the project build settings of the project and uncheck it. Doing a clean build after that will fix your problem.

Upvotes: 0

Kay
Kay

Reputation: 13146

I solved the problem in my projects by using LLVM-GCC-4.2 compiler (still XCode 3.25, don't know about the situation in XCode 4). Especially the library project that uses Obj-C, Obj-C++ and a heavily optimised C++ math template library called Eigen was otherwise not compileable.

To use LLVM-GCC go to the project info dialog (menu Project/Edit Project Settings) and click on the build tab. Look for C/C++ compiler Version and select LLVM GCC 4.2. Take care that the change is done in both configurations release and debug - you toggle between them (or edit both at once) in the configuration select box at the top.

Upvotes: 0

Jano
Jano

Reputation: 63667

That seems GCC speak for I can't jump 32k instructions away on this ARM chip, which could be solved by tweaking compilation options or not (if you made some optimization, undo it and check if that works), I'm afraid I'm no expert on that. Or maybe you added code from other project which is non ARM friendly.

Upvotes: 1

Related Questions