I am completely new to the iOS/iPhone/XCode world, so if you guess is between something rather complex and something so simple that everyone should know, I’d go with the simple answer. 🙂
Okay, so I have inherited an iPhone project that we had outsourced to another company. My only objective right now is to be able to build the dang thing. I set up XCode 4.2 and installed the proper SDKs. I loaded up the project and everything seems good to this point. However, when I build, I get errors from what I believe to be the linking stage of the build. I’m not entirely sure because the statuses change quickly when building. The error I get is the following:

From what I have been able to find online, it seems that one of the libraries I am using was not compiled for the i386 platform. To start, this doesn’t make sense to me because the libraries that I am using (where these errors are coming from) are currently included as sub-projects and produce .a files which I thought were arch-independent (am I wrong here??). Also, I can’t find anywhere in the project where I’ve instructed XCode to build to an i386 architecture. This is what I’ve done so far:
- Made sure that the file in which these errors arose was included into the “Compile Sources” section of the Build Phase tab (the .m file)
- Set my architectures to armv6 and armv7 and set the Build Active Architecture Only to no. (See images below)
Main Project Config

Sub-Project Config

Event when I build using the release configuration, I still get this error and I’m not sure why. Everything that I am looking at in my build config seems to indicate that I should be building everything in an arm architecture.
You are getting errors because you messed with the architecture settings. You should not fix those towards ARM code but allow i386 as well.
Right now, one of more of your (sub)-projects build ARM code only, resulting into a linker error once you try to build a simulator version. That is happening because your Architecture settings are not as they should be.
Note your setting for Any iOS SDK, that one is incorrect as it builds only ARM code. Remove those settings entirely by using the backspace key on your keyboard after selecting that specific setting (single-click).
And this is how it should be:

$(ARCHS_STANDARD_32_BIT)resolves toARMV7when building device specific code andi386when building simulator specific code. IncludingARMV6code as per my screenshot is only needed if you plan to serve the results to older iOS devices (iPhone 3G and below).Once those settings are active in all (sub)-projects, everything should work smoothly.
For creating a universal library out of a project, useful if you plan to distribute a static library to other developers, use
LIPO.Example:
Lets say input_library_1 was
i386specific (simulator) and input_library_2 wasARMspecific (device), this will join them into a universal version usable for both simulator and device.