iOS Unit Testing - Issue accessing functions from Native Library - ios

I'm creating a Wrapper library project which uses another Native-C library.
I'm able to use the Wrapper library functions in other applications, through which am able to accessing the functions, which are present in Native-C library.
Now, in Wrapper Library project, when I added 'Unit Testing' (using OCUnit, ), it is giving the errors for all the functions which are present in Native C library. The error is coming while executing the Unit Testing only.
The error it shows is,
**Undefined symbols for architecture i386:
"_SQMT_FUNC_close", referenced from:
_funcClose in libWrapperLibraryAlter.a(wrapperAPI.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)**
The function, 'funcClose' is present in current Wrapper Library project (.m file). The function, 'SQMT_FUNC_close' is present in Native-C library project (.c file).
Unit test execution shows error for all the Native-C functions.
Kindly help in resolving this issue.
The Lirary path:
**/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/work/Final_code/test/iOS/Debug-iphonesimulator -L/work/Final_code/test/iOS/iOSWrapper/../../Product/Library/iOS/Release-iphoneos -F/work/Final_code/test/iOS/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /work/Final_code/test/iOS/Build/Intermediates/iOSWrapper.build/Debug-iphonesimulator/wrapperTests.build/Objects-normal/i386/wrapperTests.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.0 -liOSWrapper -lHomeLittle -framework SenTestingKit -framework Foundation -framework UIKit -o /work/Final_code/iOS/Debug-iphonesimulator/wrapperTests.octest/wrapperTests**
iOSWrapper - is the current wrapper library that i'm testing.
HomeLittle - is the Native C library

Related

Use cocoa touch Framework project in multiple apps

I had two ios apps with a lot of redundand code, so i decided to extract this code to a shared cocoa touch framework and added this frameworks projectfile following RayWenderlichs tutorial .
I also read the Apples Framework Programming Guide but I am not able to solve my problem.
State Now:
The both apps work fine with the added framework.
My Problem:
I can't build both apps with target Generic iOS Device ,only real device target or a simulator.But both apps were able to build Generic iOS Device before adding the framework projects.
This is the output I get, trying to build with target Generic iOS Device:
Wished behaviour:
I'd wish the app and framework behave just like a simple project lib in C# or Java. I don't understand why this error happens.
Showing Recent Issues
Ld /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote normal armv7
cd "/Users/dkronenberger/Documents/gitRepo/Mobile/VISUS/VISUS Display"
export IPHONEOS_DEPLOYMENT_TARGET=10.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/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/iPhoneOS11.2.sdk -L/Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos -L/Users/dkronenberger/Documents/gitRepo/Mobile/VISUS/VISUS\ Display -F/Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos -F/Volumes/SoftwaresAndMedia/Adnan\ Projects/VISUS\ Project/Visus/Visus -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Users/dkronenberger/Documents/gitRepo/Mobile/VISUS/VISUS\ Display -filelist /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -miphoneos-version-min=10.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -lz -lstdc++ -framework GameKit -framework AudioToolbox -framework SystemConfiguration -framework Security -framework CFNetwork /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos/ConnectionManager.framework/ConnectionManager -framework AVFoundation -framework CoreText -framework QuartzCore -lsqlite3.0 -framework UIKit -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote_dependency_info.dat -o /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote
ld: warning: directory not found for option '-F/Volumes/SoftwaresAndMedia/Afelde Projects/VISUS Project/Visus/Visus'
ld: warning: ignoring file /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos/ConnectionManager.framework/ConnectionManager, file was built for arm64 which is not the architecture being linked (armv7): /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos/ConnectionManager.framework/ConnectionManager
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_ConnectionManager", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in HomeViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
EDIT:
I already checked the architecture validation
Apparently, your framework ConnectionManager.framework has not been configured to compile code for the armv7 architecture.
You may try to change the configuration settings of the ConnectionManager target:
Check that Valid Architectures contains all the variants: arm64, armv7 and armv7s
Try to set Build Active Architecture Only to No for Debug and Relase if it does not still work.

Xcode will not link XCTest to the iOSSimulator version

So for one of my classes, we are supposed to refactor this project from last quarter that was left in a pretty bad state.
So we are trying to write unit tests for the project, but they used an old version of Xcode, so we had to re-add the XCTest framework to "Link Binary With Libraries".
I accidentally added the MacOSX version of it the first time, and noticed my error. I removed the OS X version from the linker, and added the iPhoneSimulator version to it. It kept giving me the same error. So I removed all XCTest.framework files from the Build Phases, and it gave me an error about OCMock (which is a totally different problem that I'm not concerned about right now), which means it knows it's gone. So I then tried re-adding XCTest.framework to my test target, making sure it was the iOSSimulator version, and it gives me the same error about it being the Mac OS X version. I have tried restarting Xcode and did correctly that I did before but that did not work. Below is the full output from the error.
Ld /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator/HenryTests.xctest/HenryTests normal x86_64
cd /Users/MY_USERNAME/Git/JrProj-1415-Mike/Code/iOS/Henry
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export 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 x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk -L/Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator -L/Users/MY_USERNAME/Git/JrProj-1415-Mike/Code/iOS/Henry -F/Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Users/MY_USERNAME/Git/JrProj-1415-Mike/Code/iOS/Henry -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/Developer/Library/Frameworks -filelist /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Intermediates/Henry.build/Debug-iphonesimulator/HenryTests.build/Objects-normal/x86_64/HenryTests.LinkFileList -bundle_loader /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator/Henry.app/Henry -Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework XCTest -lOCMock -framework UIKit -framework Foundation -framework Firebase -Xlinker -dependency_info -Xlinker /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Intermediates/Henry.build/Debug-iphonesimulator/HenryTests.build/Objects-normal/x86_64/HenryTests_dependency_info.dat -o /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator/HenryTests.xctest/HenryTests
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In case anyone come across this problem too, pretty much the only solution is to make a new project, and add all the files to that new project. I've talked to some professionals in iOS development, and they could come up with no other solution. I think it has something to do with the project being from a pretty old version of Xcode, and the new XCTest framework being pretty new. Good luck to you if you come across this too.

What is causing this Crashlytics compile warning? (Auto-Linking supplied '...' framework linker option at '...' is not a dylib)

Compiling my main target (not a test target like here) yields this error:
ld: warning: Auto-Linking supplied
'~/Documents/my_app/MyApp/Crashlytics.framework/Crashlytics',
framework linker option at
~/Documents/my_app/MyApp/Crashlytics.framework/Crashlytics
is not a dylib
From this build command:
Ld /Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal i386
cd ~/Documents/my_app/MyApp
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export 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/iPhoneSimulator8.2.sdk -L~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Products/Debug-iphonesimulator -F~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Products/Debug-iphonesimulator -F~/Documents/my_app/MyApp -filelist ~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-CocoaLumberjack -lPods-Mantle -framework CFNetwork -framework Foundation -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.0 -framework CoreGraphics -lPods -framework MapKit -framework Fabric -lPods-MyApp -Xlinker -dependency_info -Xlinker ~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/MyApp_dependency_info.dat -o ~/Library/Developer/Xcode/DerivedData/MyApp-dbmrsjmskpqxmnegayfzfxgcwvsm/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp
The Missing Link:
This error is almost always produced by not having the binary linked to the library (In this case it would be the Crashlytics.framework):
Trying to build the target MyApp (which includes headers with #import <Crashlytics/Crashlytics.h> will produce the error:
ld: warning: Auto-Linking supplied
'../../Crashlytics.framework/Crashlytics', framework linker option at
../../Crashlytics.framework/Crashlytics is not a dylib
Link the Framework:
Fortunately, it should be easy to fix the problem simply by dragging the Crashlytics.framework from the Frameworks folder in the project navigator into the list of Link Binary With Libraries or by using the +.
Make sure you have your App selected/highlighted under Targets while doing this process.
I had the same issue but my reason was different.
Error Output
ld: warning: Auto-Linking supplied '~/GameFolder/Pods/Fabric/tvOS/Fabric.framework/Fabric', framework linker option at ~/GameFolder/Pods/Fabric/tvOS/Fabric.framework/Fabric is not a dylib
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Answers", referenced from:
type metadata accessor for __ObjC.Answers in GameScene.o
type metadata accessor for __ObjC.Answers in AppDelegate.o
"_OBJC_CLASS_$_Crashlytics", referenced from:
type metadata accessor for __ObjC.Crashlytics in AppDelegate.o
"_OBJC_CLASS_$_Fabric", referenced from:
type metadata accessor for __ObjC.Fabric in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Reason
My target was overriding the OTHER_LDFLAGS.
Solution
Changed the OTHER_LDFLAGS to just inherit the Linker Flags. Basically, changed it to $(inherited)
I followed all steps provided by #i'L'i but I was not able to find Crashlytics.framework and Fabric.framework file in build phases.
So this helped me.
Step 1: Follow all the steps given Here.
Step 2: Now when you are unable to find Crashlytics.framework and Fabric.framework files in Link Binary With Libraries by clicking + do following.
2.1: Click on + button in Link Binary With Libraries.
2.2: Click on Add Other... button.
2.3: Now chose Crashlytic.framework and Fabric.framework from Pod folder - if using cocoapods, else choose both file from where you have downloaded it.
Step 3: Build Succeeded, Enjoy. :)
For future reference, this can also happen if you link your test files to your app target.
For example:
https://github.com/realm/realm-cocoa/issues/1661
I had the same problem. Maybe I messed up the initial fabric install but once I added Fabric.framework to the list of frameworks (should be in the root folder of your app by default) everything worked.
Conversely to what I'L'I and user3517250 mention, the problem might also be that you have #import statements that shouldn't be there.
Xcode does infer the frameworks to link against from the #import statements. If you import a framework that you don't link against, then you get this warning.

Apple Mach-O-Linker Error CocoaPods

I've been trying to get my app up and running. From what I could tell the app was missing Cocoapods as a dependency. So. I installed and added Cocoapods. But I'm still getting the same error for whatever reason. I'm an inexperienced developer trying to teach himself I must add.
Ld
/Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator/Umbrella.app/Umbrella
normal i386
cd "/Users/bfarag/Desktop/The Nerdery/BRAVO.iOS.CodeChallenge"
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export 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.1.sdk
-L/Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator
-F/Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator
-filelist /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Intermediates/Umbrella.build/Debug-iphonesimulator/Umbrella.build/Objects-normal/i386/Umbrella.LinkFileList
-Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-Umbrella-AFNetworking -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration
-fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework Accelerate -framework UIKit -framework Foundation -framework CoreGraphics -lPods -lPods-Umbrella -Xlinker -dependency_info -Xlinker /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Intermediates/Umbrella.build/Debug-iphonesimulator/Umbrella.build/Objects-normal/i386/Umbrella_dependency_info.dat
-o /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator/Umbrella.app/Umbrella
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This error usually occurs either when you don't have the correct frameworks (might be missing one) or when you don't have the right thing in linker flags.
Go to the main page for the app (on the navigation thing on the left click on your apps name or the top section) -> Build Settings and under Linker Flags, make sure there is nothing in your Other Linker Flags. I had this same error when I had -ObjC in my other Linker Flags.
You might also want to try adding -lPods to your Other Linker Flags or adding the CoreGraphics framework if you don't already have it.
Good luck
Open workspace file, not project file. Cocoapods automatically creates a xcworkspace file on the same directory as xcproject file.
Xcode started displaying this message and I tried pretty much everything to solve it. What finally did the trick for me was deleting all content from ~/Library/Developer/Xcode/DerivedData/

Unable to call methods from static library Pax86

I wanted to use the Pax86 library for iOS. Intially I tried creating the library manually, as I had all the required files. But it consists of file with code to create a static library which can be run on the terminal but only for iPhonesdk4.3. Since I have the iPhonesdk7.1 I was not able to create the Pax86 library. I do not have a system with iPhonesdk4.3. A static library build on iPhoneSDK4.3 was later provided.
I added the static library (.a) file to a new project also included the "include" file of pax86 to the new app.
When i try calling any method related to pax86, error occurs as mentioned below:
For Simulator:
Ld /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphonesimulator/abc.app/abc normal i386
cd /Users/xyz/Documents/Sample_programs/abc
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Users/xyz/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/ramani/Documents/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/xyz/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Users/xyz/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphonesimulator -L/Users/xyz/Documents/Sample_programs/abc/abc -L/Users/xyz/Documents/Sample_programs/abc/abc -F/Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphonesimulator -filelist /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Intermediates/abc.build/Debug-iphonesimulator/abc.build/Objects-normal/i386/Shell.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework CoreLocation -framework CoreGraphics -lpax86 -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Intermediates/abc.build/Debug-iphonesimulator/Shell.build/Objects-normal/i386/abc_dependency_info.dat -o /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphonesimulator/abc.app/abc
ld: warning: ignoring file /Users/xyz/Documents/Sample_programs/abc/abc/libpax86.a, file was built for archive which is not the architecture being linked (i386): /Users/xyz/Documents/Sample_programs/abc/abc/libpax86.a
Undefined symbols for architecture i386:
"_retro_api_version", referenced from:
-[ViewController viewDidLoad] in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
For Device:
Ld /Users/xyz/Library/Developer/Xcode/DerivedData/Shell-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphoneos/abc.app/Shell normal armv7
cd /Users/ramani/Documents/Sample_programs/Shell
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Users/xyz/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/ramani/Documents/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/xyz/Documents/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Users/xyz/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/ramani/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphoneos -L/Users/xyz/Documents/Sample_programs/abc/abc -L/Users/xyz/Documents/Sample_programs/abc/abc -F/Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphoneos -filelist /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Intermediates/abc.build/Debug-iphoneos/Shell.build/Objects-normal/armv7/Shell.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.1 -framework CoreLocation -framework CoreGraphics -lpax86 -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Intermediates/abc.build/Debug-iphoneos/Shell.build/Objects-normal/armv7/abc_dependency_info.dat -o /Users/xyz/Library/Developer/Xcode/DerivedData/abc-dvbzzlhzahggryayfurclxrbdjio/Build/Products/Debug-iphoneos/abc.app/abc
ld: archive has no table of contents file '/Users/xyz/Documents/Sample_programs/abc/abc/libpax86.a' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have set "Build Active Architecture" to both "YES" and "NO" removed all other architecture like armv7s, arm64 etc but still the above mentioned issues occur.
I have even added the .a file to usr/lib and then added it in Build Settings. cleared the Library Search Path and Framework Search Path.
I imported the static libary as present in the screenshot attached, and tried even without the "include".
Could you please help me resolve this issue. Is it because the static library is only meant for iPhoneSDK4.3 and not iPhoneSDK7.1 or any other SDK. I have tried it in iPhoneSDK3.2 as well, but no luck.
Please help.
Thanks in advance.
The static library was built for iPhone SDK 4.3, and will only work with that. It probably contains symbols for architecture armv6 only, while you are trying to use in i386 (simulator) and armv7/armv7s/arm64 (devices).
Your solution is to build that library using newer SDKs.

Resources