missing required architecture armv7 in file XCTest on building application target - ios

To start, i looked at all the other search topics and none applied or didn't work. For example, i have a hard time that apple didn't make xctest compatible with all architectures.
On a Xcode project for work i randomly started getting the following build error on linking:
Ld /Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates/InVenueExperience.build/Debug-iphoneos/InVenueExperience.build/Objects-normal/armv7/InVenueExperience normal armv7
cd /Users/eallen/tmdev/ios/mive
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Products/Debug-iphoneos -L/Users/eallen/tmdev/ios/mive -L/Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates -F/Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Products/Debug-iphoneos -FFrameworks -FPods/Pixate/Framework/iOS -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/Developer/Library/Frameworks -filelist /Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates/InVenueExperience.build/Debug-iphoneos/InVenueExperience.build/Objects-normal/armv7/InVenueExperience.LinkFileList -dead_strip -ObjC -lObjC -lxml2 -framework CoreGraphics -framework CoreText -framework MobileCoreServices -framework Pixate -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -fprofile-arcs -ftest-coverage -miphoneos-version-min=7.0 -lPods -framework QuartzCore -framework CoreText -framework CoreGraphics -framework CoreData -framework UIKit -framework Foundation -framework Crashlytics -Xlinker -dependency_info -Xlinker /Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates/InVenueExperience.build/Debug-iphoneos/InVenueExperience.build/Objects-normal/armv7/InVenueExperience_dependency_info.dat -o /Users/eallen/Library/Developer/Xcode/DerivedData/InVenueExperience-fgszkxctprmkuvbvwzgprcuveheo/Build/Intermediates/InVenueExperience.build/Debug-iphoneos/InVenueExperience.build/Objects-normal/armv7/InVenueExperience
ld: in '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest', missing required architecture armv7 in file /Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest (2 slices) for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
All this while trying to build my application target and NOT my test target. Some further notes:
I am NOT linking against XCTest in my build settings for the application target
I am building, not testing this specific target
I do have in both my build settings -> Architectures|Valid Architectures "Standard Architectures (armv7, armv7s).
This only happens when i build for a iOS device and not a simulator...i think this is because building for a simulator only tries the i386 architecture?
To be honest, i have no idea why the linker is even trying to link against XCTest in this case...i even modified the scheme to remove all tests though i wasn't trying to test against the target.
Please feel free to ask me any other questions.

You may have the same simple but frustrating problem as I had. It's a scheme setting:
Click on your project scheme in the toolbar (right of the play/stop buttons), and select 'Edit' from the popup. Under the 'Build' item on the left, make sure your test targets only have 'Test' checked.

Please make sure the Build Setting of "build Active Architecture only" is set to NO, maybe it's the cause of this problem.

Turns out that buried deep in the compile sources for the application target i had a file that included imports for XCTest stuff...removing this immediately made this go away.
So answer being verify that you do not have anything in your compile sources list that may reference a library you didn't intend

I just had the same issue after including a third-party project. When selecting the target I chose the main project target (not the test target), but the included project had a sub-target which were unit tests. Xcode helpfully added those to my main application target. After changing the target setting for the relevant file it worked alright.

It happens that after adding $(PLATFORM_DIR)/Developer/Library/Frameworks as a first item in <Target>/<Build Settings>/<Search Paths>/<Framework Search Paths> I got rid of nasty "ld: framework not found XCTest for architecture arm64" link error by using XCode 6.3.1.

Related

iOS - can't link with a main executable file (release)?

I recently updated XCode to V 11.1, and since updating, for some reason when I run my app in release mode, I'm thrown the following error:
ld: can't link with a main executable file
'/Users/me/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos/myapp.app/myapp'
for architecture armv7 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
I have absolutely no clue how to resolve this - and I can't run my app in release mode without it (and yes, I'm using a Distribution profile). Help would be much appreciated. I've browsed a few other answers but none seem to solve this issue.
When I navigate to that file path, 'myapp' is simply an icon with a circle and a slash through it (can't be a good sign). This same thing occurs even after I clean the build folder. When I try to rebuild in release mode, the build fails and throws me the above yet again.
See full error:
Ld
/Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/Binary/myappTests
normal armv7 (in target 'myappTests' from project 'myapp')
cd /Users/admin/Desktop/myapp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-target armv7-apple-ios8.4 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk
-L/Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos
-F/Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk/Developer/Library/Frameworks
-F/Users/admin/Desktop/myapp/Pods/FirebaseAnalytics/Frameworks -F/Users/admin/Desktop/myapp/Pods/GoogleAppMeasurement/Frameworks -F/Users/admin/Desktop/myapp/Pods/GoogleMaps/Base/Frameworks -F/Users/admin/Desktop/myapp/Pods/GoogleMaps/Maps/Frameworks -F/Users/admin/Desktop/myapp/Pods/GooglePlaces/Frameworks -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks
-filelist /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/myappTests.LinkFileList
-Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -rpath -Xlinker #loader_path/Frameworks -dead_strip -bundle_loader /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos/myapp.app/myapp
-Xlinker -object_path_lto -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/myappTests_lto.o
-fobjc-arc -fobjc-link-runtime -lc++ -licucore -lsqlite3 -lz -framework Accelerate -framework CFNetwork -framework CoreData -framework CoreGraphics -framework CoreImage -framework CoreLocation -framework CoreTelephony -framework CoreText -framework Foundation -framework GLKit -framework ImageIO -framework OpenGLES -framework QuartzCore -framework Security -framework StoreKit -framework
SystemConfiguration -framework UIKit -framework XCTest
-lPods-myappTests -Xlinker -dependency_info -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/myappTests_dependency_info.dat
-o /Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Intermediates.noindex/myapp.build/Release-iphoneos/myappTests.build/Objects-normal/armv7/Binary/myappTests
ld: can't link with a main executable file
'/Users/admin/Library/Developer/Xcode/DerivedData/myapp-btokobigvkxtgwgcjrapocxlexno/Build/Products/Release-iphoneos/myapp.app/myapp'
for architecture armv7 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
Finally found the fix in my case. Hopefully this answer is helpful to others.
Product > Scheme > Edit Scheme, and then tap the 'Build' category on
the left hand side.
Under your appTests targets, uncheck "Run".
Problem solved.
Could you say where do you find the slashed icon - it may be a sign Xcode tries to look at a wrong path. You may easily verify it with right-click on the project from Project Navigator, show in Finder.
I recommend Changing deployment target to 8.4.
A solution might be going to Product > Scheme > Edit Scheme, choose Build and uncheck 'Run'
I was getting the ld: can't link with a main executable file error because the Build Settings between my app target and the test app were different, mainly the iOS Deployment Target.
Ensuring that these two were the same allowed the build to succeed.

xcode library not found for -lobjc

I am getting this error when I am trying to run it on my device, however it working fine when I run it on simulator. Is this a tool chain error or SDK header error? Below is the error message I obtain when compiling.
Error Message:
Ld /Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Intermediates/mobiletimetec.build/Debug-iphoneos/mobiletimetec.build/Objects-normal/armv7/mobiletimetec normal armv7
cd /Users/KhangYu/Desktop/KPTesting/setting
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Products/Debug-iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system -F/Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Products/Debug-iphoneos -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Intermediates/mobiletimetec.build/Debug-iphoneos/mobiletimetec.build/Objects-normal/armv7/mobiletimetec.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.1 -framework SystemConfiguration -framework AVFoundation -lsqlite3.0 -framework MapKit -framework CoreLocation -framework MessageUI -framework QuartzCore -framework Security -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Intermediates/mobiletimetec.build/Debug-iphoneos/mobiletimetec.build/Objects-normal/armv7/mobiletimetec
ld: library not found for -lobjc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
//-- END --
This is going to be the death of me. Any idea on how to solve it? Your help will be greatly appreciated.
Thanks in advance.
Solution
Thanks Kevin and Jasper Blues reply and also thanks Reno Jones to edit my post.
After hours of trying to fix this, I renamed the file "libobjc.A.dylib" to "libobjc.dylib"and the error disappear.
P/S: "libobjc.A.dylib" - located in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer‌​/SDKs/*/usr/lib/, thanks again to Kevin.
My guess is that it works on the Simulator, but not the device because you've specified separate 'OTHER LINKER FLAGS' for both 'Debug' and 'Release' configurations. You'd usually do this if you're linking in a debug framework such as 'Reveal', 'DCIntrospect', etc.
The one for 'Release' looks to be incorrect. It should be '-Objc' and not '-lObjc' - we're telling the compiler that we're using Objective-C itself, and not to load a library called 'Objc'.
To correct:
In Xcode, click on the target for your App.
Open the 'Build Settings' tab.
Search for 'Other linker flags' - so you're not overwhelmed by options.
Correct the 'Release' config. Change '-lObjc' to '-Objc'
There is no need to rename "libobjc.A.dylib", just re-link it like : ln -s ./libobjc.A.dylib ./libobjc.dylib

No changes in testflight libraries and Xcode 5 now says "ld: library not found for -lTestFlight"

I've been creating some app for some months, and suddently Xcode 5 doesn't want to build it. It just complains with the following error.
Ld build/Debug-iphonesimulator/appname.app/appname normal i386
cd /Users/myname/proyectos/appname/dev/iOS/appname
setenv IPHONEOS_DEPLOYMENT_TARGET 5.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/myname/proyectos/appname/dev/iOS/appname/build/Debug-iphonesimulator -L\"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/FlurryAnalytics\" -L\"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/SmartADServer\" -L\"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/TestFlight\" -F/Users/myname/proyectos/appname/dev/iOS/appname/build/Debug-iphonesimulator -F/Users/myname/proyectos/appname/dev/iOS/appname/appname/External -filelist /Users/myname/proyectos/appname/dev/iOS/appname/build/appname.build/Debug-iphonesimulator/Appname.build/Objects-normal/i386/appname.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1 -weak_framework AdSupport -framework Security -framework MessageUI -framework Twitter -framework CoreLocation -weak_framework CoreMotion -framework AudioToolbox -framework AVFoundation -framework MediaPlayer -framework SystemConfiguration -framework MobileCoreServices -lz -framework CFNetwork -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -lTestFlight -framework comScore -lFlurry -Xlinker -dependency_info -Xlinker /Users/myname/proyectos/appname/dev/iOS/appname/build/appname.build/Debug-iphonesimulator/Appname.build/Objects-normal/i386/appname_dependency_info.dat -o /Users/myname/proyectos/appname/dev/iOS/appname/build/Debug-iphonesimulator/appname.app/appname
ld: warning: directory not found for option '-L"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/FlurryAnalytics"'
ld: warning: directory not found for option '-L"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/SmartADServer"'
ld: warning: directory not found for option '-L"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/TestFlight"'
ld: library not found for -lTestFlight
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I understand it ok, it complains about testflight, but I haven't changed anything about it in weeks. It compiled it perfectly.
I have to say I've tried adding Adobe ADMS tracking library onto the project (but then undoing its addition). And then after that, linker errors appear.
Any hint? I'm COMPLETELY at lost and frustrated. Are my project files corrupt maybe? (Let's hope not!!) Any hope to recover them in such case?
Greetings
"Problem solved".
Apparently it seemed (as ahwulf said, and I suspected) that my Project paths/libraries/headers where somehow corrupt inside Xcode 5.
What was my solution? After more additional tests, I just physically removed some of my apparently conflicting libraries (testflight, flurry, etc...) from the project (and ALSO from disk) and started compiling, waiting for the obvious compilation errors that would appear.
When they appeared, I just re-added the files XCode asked me to add (one file/library at a time), and then one by one, all these errors started to slowly disappear.
My original linking error ALSO disappeared, so my project builds again.
I have the feeling I don't really know what I did, but "it worked".
Something that worked for me in this situation was to remove 'libTestFlight.a' from my Link Binary With Libraries section in the Build Phases and clean my project then redrag it into this section from my File tree. (Of course if you want to use Testflight in your app make sure that you also have libz.dylib as a framework and the associated TestFlight files are also included in your project such as TestFlight.h, TeshFlight+AsyncLogging.h and TestFlight+ManualSession.h - if libz.dylib gets deleted and then readded it can cause this error). Good luck code warriors!
XCode 5 appears to have a bug where it spontaneously adds an extra absolute path in build settings. Bitten me a couple of times already.
I had the identical error for a very different reason.
Having upgraded from TestFlight 1.2.4 to TestFlight 2.0.2, the build worked on my own machine, but a nightly build on a different machine failed.
The simple reason that the library wasn't found was that it hadn't been committed. Our .gitignore is set to ignore .a files, so libTestFlight.a had not been included. Opening the project in Xcode made this more obvious than the command line build log.
git add -f sorted this out.
I've faced the exact same problem with adding TestFlight 2.0.2. And it was also conflicting with Flurry (and some others). Removing (reference!) and re-adding all conflicting libraries with TestFlight being last helped me. But firstly don't forget to delete Library Search Paths.

Xcode 4.5 & iOS 6 Linking error with Tapuku Library

I only receive this error when my project compiles for running on an iOS device. Has anyone experienced an issue similar to this? I am attempting to run my project on a device. I have looked just about everywhere and am unable to find a solution. Any help on this would be appreciated.
Ld /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/McKendree.app/McKendree normal armv7
cd /Users/dapage/Developer/workspace/McKendree
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos -L/Users/dapage/Developer/workspace/McKendree -L/Users/dapage/Developer/workspace/McKendree/Libraries -L/Users/dapage/Developer/workspace/McKendree/Libraries/OAuthConsumer -L/Users/dapage/Developer/workspace/McKendree/Libraries/TestFlight -L/Users/dapage/Developer/workspace/McKendree/../../../Downloads/TestFlightSDK1 -F/Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos -filelist "/Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Intermediates/McKendree University.build/Debug-iphoneos/McKendree.build/Objects-normal/armv7/McKendree.LinkFileList" -dead_strip -ObjC -fobjc-link-runtime -miphoneos-version-min=4.0 /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libThree20UI.a /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libThree20UICommon.a /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libThree20UINavigator.a /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libextThree20XML.a /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libThree20.a /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libThree20Core.a /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libThree20Network.a /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libThree20Style.a /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libTapkuLibrary.a -framework AddressBook -framework AddressBookUI -framework AudioToolbox -lz -framework QuartzCore -framework Foundation -framework UIKit -framework CoreGraphics -framework MapKit -framework MessageUI -framework MediaPlayer -framework AVFoundation -framework SystemConfiguration -framework CoreLocation -lxml2 -lsqlite3.0 -framework CFNetwork -framework Security -lOAuth -lTestFlight -o /Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/McKendree.app/McKendree\
The error is:
clang: error: no such file or directory: '/Users/dapage/Library/Developer/Xcode/DerivedData/McKendree_University-clkfusicbtxoumeeuoisuduipobw/Build/Products/Debug-iphoneos/libTapkuLibrary.a'
Make sure that the library binary is under the project root and that you add it as a reference. You can do this by selecting the project in the Project Navigator (Cmd-1) and then select Build Phases. Under Link Binary with Libraries you should have a reference to the binary. You may also want to add the library binary to your project, which may automatically at it as a linked binary. You can also edit Library Search Paths under Build Settings and add the folder where you have this binary file.
"$(SRCROOT)/lib"
If you have the binary in that folder it may find it easier that way. You will also need to reference headers for this library so look at setting Header Search Paths and adding the header files to your project.
If you can, I prefer to add code from third party libraries as Static Libraries and adding them as a dependency. You can do this first as a separate project and get it to build successfully on it's own. Then you can drag that project file into the other project in Xcode and set it up as a dependency. You will need to understand how schemes manage the build project for dependencies to set up a sub-project. You may find this approach to be much easier than linking to a pre-compiled library which may not include the required architectures for the devices that Apple releases. If you have the source code as a dependencies you will be able to build the necessary binary versions.

Why is my linker trying to link against old iOS SDK?

I'm able to build my iOS project right now, but I'm getting two warnings like the following that are really annoying me:
ld: warning: directory not found for option
'-L/Users/brennon/Development/MobileMuse/BioAudio/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib'
(I've broken the compiler command over several lines in a futile attempt at readability):
Ld /Users/brennon/Library/Developer/Xcode/DerivedData/BioAudio-avxobobusfxeffaswkzteodevihm/Build/Intermediates/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv7/BioAudio normal armv7
cd /Users/brennon/Development/MobileMuse/BioAudio
setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2
-arch armv7
-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
-L/Users/brennon/Library/Developer/Xcode/DerivedData/BioAudio-avxobobusfxeffaswkzteodevihm/Build/Products/Debug-iphoneos
-L/Users/brennon/Development/MobileMuse/BioAudio
-L/Users/brennon/Development/MobileMuse/BioAudio/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib
-F/Users/brennon/Library/Developer/Xcode/DerivedData/BioAudio-avxobobusfxeffaswkzteodevihm/Build/Products/Debug-iphoneos
-filelist /Users/brennon/Library/Developer/Xcode/DerivedData/BioAudio-avxobobusfxeffaswkzteodevihm/Build/Intermediates/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv7/BioAudio.LinkFileList
-dead_strip -miphoneos-version-min=4.3 -framework Foundation
-framework UIKit -framework CoreGraphics -framework AudioToolbox
-framework Security
-o /Users/brennon/Library/Developer/Xcode/DerivedData/BioAudio-avxobobusfxeffaswkzteodevihm/Build/Intermediates/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv7/BioAudio
It seems to still be trying to link against the 4.2 SDK, which is no more since upgrading my development machine to 10.7 and, hence, Xcode. I've scoured the Project and Target settings, and can't seem to find anything still pointing to 4.2. Any ideas?
EDIT: I tried dtuckernet's answer. Running grep -iRF iPhoneOS4.2.sdk . in the project directory produced the following (sorry about the mess!) output:
./BioAudio.xcodeproj/project.pbxproj: "\"$(SRCROOT)/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib\"",
./BioAudio.xcodeproj/project.pbxproj: "\"$(SRCROOT)/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib\"",
./BioAudio.xcodeproj/project.xcworkspace/xcuserdata/brennon.xcuserdatad/UserInterfaceState.xcuserstate: <string>file://localhost/Users/brennon/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib/liblo.a</string>
./BioAudio.xcodeproj/project.xcworkspace/xcuserdata/brennon.xcuserdatad/UserInterfaceState.xcuserstate: <string>file://localhost/Users/brennon/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib/liblo.a</string>
./BioAudio.xcodeproj/project.xcworkspace/xcuserdata/brennon.xcuserdatad/UserInterfaceState.xcuserstate: <string>Directory not found for option '-L/Users/brennon/Development/MobileMuse/BioAudio/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib'</string>
./build/BioAudio.build/Debug-iphoneos/BioAudio.build/build-state.dat:N/Users/brennon/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib/liblo.a
./build/BioAudio.build/Debug-iphoneos/BioAudio.build/build-state.dat:N/Users/brennon/Development/BioAudio/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib/liblo.a
./build/BioAudio.build/Debug-iphoneos/BioAudio.build/build-state.dat:lSLF07#2#121"Link /Users/brennon/Development/BioAudio/build/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv6/BioAudio3 /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -L/Users/brennon/Development/BioAudio/build/Debug-iphoneos -L/Users/brennon/Development/BioAudio -L/Users/brennon/Development/BioAudio/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib -F/Users/brennon/Development/BioAudio/build/Debug-iphoneos -filelist /Users/brennon/Development/BioAudio/build/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv6/BioAudio.LinkFileList -dead_strip -miphoneos-version-min=4.2 -framework Foundation -framework UIKit -framework CoreGraphics -framework AudioToolbox -llo -framework Security -o /Users/brennon/Development/BioAudio/build/BioAudio.build/Debug-iphoneos/BioAudio.build/O0#ects-normal/armv6/BioAudio
./build/BioAudio.build/Debug-iphoneos/BioAudio.build/build-state.dat:lSLF07#2#121"Link /Users/brennon/Development/BioAudio/build/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv7/BioAudio3 /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -L/Users/brennon/Development/BioAudio/build/Debug-iphoneos -L/Users/brennon/Development/BioAudio -L/Users/brennon/Development/BioAudio/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib -F/Users/brennon/Development/BioAudio/build/Debug-iphoneos -filelist /Users/brennon/Development/BioAudio/build/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv7/BioAudio.LinkFileList -dead_strip -miphoneos-version-min=4.2 -framework Foundation -framework UIKit -framework CoreGraphics -framework AudioToolbox -llo -framework Security -o /Users/brennon/Development/BioAudio/build/BioAudio.build/Debug-iphoneos/BioAudio.build/O0#ects-normal/armv7/BioAudio
Binary file ./build/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv6/BioAudio matches
Binary file ./build/BioAudio.build/Debug-iphoneos/BioAudio.build/Objects-normal/armv7/BioAudio matches
./build/BioAudio.build/Debug-iphonesimulator/BioAudio.build/build-state.dat:N/Users/brennon/Development/BioAudio/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib/liblo.a
./build/BioAudio.build/Debug-iphonesimulator/BioAudio.build/build-state.dat:old: warning: in /Users/brennon/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib/liblo.a, file was built for unsupported file format which is not the architecture being linked (i386)
./build/BioAudio.build/Debug-iphonesimulator/BioAudio.build/build-state.dat:lSLF07#2#90"Link /Users/brennon/Development/BioAudio/build/Debug-iphonesimulator/BioAudio.app/BioAudio318119306#318119307#0(372"ld: warning: in /Users/brennon/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib/liblo.a, file was built for unsupported file format which is not the architecture being linked (i3865(22#192"In /Users/brennon/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib/liblo.a, file was built for unsupported file format which is not the architecture being linked (i386)318119307#0#206#0(6#0"318119307#0#0#0#0#0"0(4#46""_lo_address_new_with_proto", referenced from:318119307#225#49#0(6#0"318119307#0#0#0#0#0"0(13#31"-[BioAudio setup] in BioAudio.o318119307#274#38#0(6#0"318119307#0#0#0#0#0"0(13#19"Symbol(s) not found318119307#312#24#0(6#0"318119307#0#0#0#0#0"0(13#35"Collect2: ld returned 1 exit status318119307#336#36#0(6#0"318119307#0#0#0#0#0"0(0#0#0"8640817536#1094" cd /Use /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/brennon/Development/BioAudio/build/Debug-iphonesimulator -L/Users/brennon/Development/BioAudio -L/Users/brennon/Development/BioAudio/../../Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/lib -F/Users/brennon/Development/BioAudio/build/Debug-iphonesimulator -filelist /Users/brennon/Development/BioAudio/build/BioAudio.build/Debug-iphonesimulator/BioAudio.build/Objects-normal/i386/BioAudio.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework AudioToolbox -llo -framework Security -o /Users/brennon/Developm1#t/BioAudio/build/Debug-iphonesimulator/BioAudio.app/BioAudio
Binary file ./build/Debug-iphoneos/BioAudio.app/BioAudio matches
Changing the entries in pbproject.pbxproj to 4.3 was easy enough, but the same warnings are still thrown on build. Cleaning still doesn't resolve anything. I feel uneasy about just altering the plist keys in the plists under brennon.xcuerdatad. I'm sure the issue is either here or in the build-state files, but shouldn't those be refreshed/rebuilt on a clean and build?
There is still a reference somewhere in your project settings to 4.2 In the past I've used grep to go through all the files in my project and find the reference. See this example:
cd ~/Documents/MyProjectDirectory/
grep -iRF 4.2 .
This should give you all files that contain 4.2, and it should be easy to see where the 4.2 SDK is referenced.
Different configurations Debug / Release may have different settings for a target iOS. Check that configuration that you are compiling match your expectations for iOS that should be set in it.

Resources