Unable to call methods from static library Pax86 - ios

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.

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.

clang: error: linker command failed with exit code 1 iOS9

I am getting the following error while running the code.I have recently updated my xcode to xcode 7.
Ld /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/cdm_reference_player.app/cdm_reference_player normal armv7
cd /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template
export IPHONEOS_DEPLOYMENT_TARGET=7.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/iPhoneOS9.0.sdk -L/Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos -L/Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug -L/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios/dev -F/Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos -F/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios/dev -F/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/dev -F/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release -filelist /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Intermediates/cdm_player_ios.build/Debug-iphoneos/cdm_reference_player.build/Objects-normal/armv7/cdm_reference_player.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -miphoneos-version-min=7.0 -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework oemcrypto_tfit2-eit_release_dylib /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/libCocoaAsyncSocket.a /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/libCocoaHTTPServer.a /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/libTBXML-iOS.a -framework AVFoundation -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreMedia -framework Foundation -framework Security -framework UIKit -framework oemcrypto_tfit2-eit_dev_dylib -framework oemcrypto_tfit2_dev_dylib_sim -Xlinker -dependency_info -Xlinker /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Intermediates/cdm_player_ios.build/Debug-iphoneos/cdm_reference_player.build/Objects-normal/armv7/cdm_reference_player_dependency_info.dat -o /Users/anurajennai/Library/Developer/Xcode/DerivedData/cdm_player_ios-cvwkkaawlnzyccamzriqmgoezgqi/Build/Products/Debug-iphoneos/cdm_reference_player.app/cdm_reference_player
ld: '/Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release/oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
EDIT
see this image.In the error log,it says
oemcrypto_tfit2-eit_release_dylib' does not contain bitcode
do which one do I have to set "NO" and which one to "YES"?
after changing BITCODE setting(if both debug and release are NO,the same error is coming)
ld: warning: ignoring file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release/oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib, missing required architecture i386 in file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release/oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib (2 slices)
ld: warning: ignoring file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios/dev/oemcrypto_tfit2-eit_dev_dylib.framework/oemcrypto_tfit2-eit_dev_dylib, missing required architecture i386 in file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios/dev/oemcrypto_tfit2-eit_dev_dylib.framework/oemcrypto_tfit2-eit_dev_dylib (2 slices)
ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later (#rpath/oemcrypto_tfit2_dev_dylib_sim.framework/oemcrypto_tfit2_dev_dylib_sim) for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib
Doesn't contain bitcode, either ask the vendor of this library to provide bit code or disable bitcode for this project
Please read the error message again:
'oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture armv7
As far as I can see you have already solved problem with Bitcode, so my answer only about last error messages:
ld: warning: ignoring file /Users/anurajennai/Desktop/myApps/unziped/cdm_player_xcode_template/oemcrypto_tfit_ios_dylib/release/oemcrypto_tfit2-eit_release_dylib.framework/oemcrypto_tfit2-eit_release_dylib, missing required architecture i386 in file
means that lib doesn't have i386 arch (can't be used on simulator) try build for iOS device
second one:
ld: embedded dylibs/frameworks are only supported on iOS 8.0 and later
but I see that in your project:
export IPHONEOS_DEPLOYMENT_TARGET=7.0
deployment target set to 7.0 so you should decide something with it

I am creating a bar chart in iOS using TeleriKUi.framework but I got 3 linker error at run time

I am creating a bar chart in iOS using TeleriKUi.framework but I got 3 linker error at run time.
I am using Xcode 5.
Ld /Users/harikant/Library/Developer/Xcode/DerivedData/DemoChart-dhiujvurrxcrawfzlfqevsxfnlkg/Build/Products/Debug-iphonesimulator/DemoChart.app/DemoChart normal i386
cd /Users/harikant/Desktop/DemoChart
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
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/harikant/Library/Developer/Xcode/DerivedData/DemoChart-dhiujvurrxcrawfzlfqevsxfnlkg/Build/Products/Debug-iphonesimulator -F/Users/harikant/Library/Developer/Xcode/DerivedData/DemoChart-dhiujvurrxcrawfzlfqevsxfnlkg/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/harikant/Library/Developer/Xcode/DerivedData/DemoChart-dhiujvurrxcrawfzlfqevsxfnlkg/Build/Intermediates/DemoChart.build/Debug-iphonesimulator/DemoChart.build/Objects-normal/i386/DemoChart.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework GameKit -framework TelerikUI -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/harikant/Library/Developer/Xcode/DerivedData/DemoChart-dhiujvurrxcrawfzlfqevsxfnlkg/Build/Intermediates/DemoChart.build/Debug-iphonesimulator/DemoChart.build/Objects-normal/i386/DemoChart_dependency_info.dat -o /Users/harikant/Library/Developer/Xcode/DerivedData/DemoChart-dhiujvurrxcrawfzlfqevsxfnlkg/Build/Products/Debug-iphonesimulator/DemoChart.app/DemoChart
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_UIBlurEffect", referenced from:
objc-class-ref in TelerikUI(SideDrawerSlideInOnTop.o)
"_OBJC_CLASS_$_UIVisualEffectView", referenced from:
objc-class-ref in TelerikUI(SideDrawerSlideInOnTop.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Did you link the UIKit framework in your project? Usually when you get a 'Undefined symbols for architecture' error you can copy the method which it references and paste that into Google and see what framework it came from, if that framework was not linked in your project then just add the framework and try again. In your case '_UIBlurEffect' was not found and Google tells me that it's part of the UIKit Framework from Apple.

Linker Error with Tests in Xcode

I was following along the instructions for building tests using xcode/appcode from TDD site. I got through the initial part ok and started to experiment in my own project, but I keep getting a linking error and can't figure out where from?
The output I get is this
Ld /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator/acidplusTests.octest/acidplusTests normal i386
cd /Volumes/Defiant/Freeradical/freeradical_newacidbase/acidplus
setenv IPHONEOS_DEPLOYMENT_TARGET 6.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 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator -LLibs/OCMock/iOS -LLibs/OCMock/iOS/OCMock -F/Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/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 /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Intermediates/acidplus.build/Debug-iphonesimulator/acidplusTests.build/Objects-normal/i386/acidplusTests.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -force_load Libs/OCMock/iOS/libOCMock.a -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework CoreGraphics -framework SenTestingKit -framework UIKit -framework Foundation -lOCMock -o /Users/prasanth/Library/Developer/Xcode/DerivedData/acidplus-ctbnayjfiyhfxkccqyopjsnfagos/Build/Products/Debug-iphonesimulator/acidplusTests.octest/acidplusTests
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_BPG_testModelObject", referenced from:
objc-class-ref in testModelTest.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried looking at missing Sources or Linked libraries, but couldn't find anything. Anyone know what else could be wrong?
thanks!
Have you tried the following:
Go to XCode, Under Project -> do a clean and Build your solution again.

iOS Unit Testing - Issue accessing functions from Native Library

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

Resources