We've implemented a static library and trying to use it on the project. The library is compiled/build well but as we try to run the project after importing .a & .h files respectively, we encountered with following error :
ld: warning: ignoring file Lib.a, file was built for archive which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MFourInOneStaticLib", referenced from:
objc-class-ref in MAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've already checked the architecture.More-over, we're using the simulator for the testing purpose.
well looks the your lib doesnt contain the right architecture.
for ios you need armv7 and for the simulator you need i386
to test it
lipo -info %NAME%
often a lipo is only built for EITHER arm OR x86
built it for both archs and then combine the two files
lipo ./build/Release-iphoneos/%NAME% ./build/Release-iphonesimulator/%NAME% -output ./Dist/lib/%NAME% -create
Related
I am using Unity3D5.2 to export a iOS project, but when compile in Xcode encounter this problem,please help!
ld: warning: directory not found for option '-
L/Users/lzy/Downloads/IOS88888/LibrariesPlugins/iOS'
Undefined symbols for architecture arm64:
"_saveToGallery", referenced from:
_ScreenshotManager_saveToGallery_m182 in Bulk_Assembly-CSharp_0.o
(maybe youmeant: _ScreenshotManager_saveToGallery_m182)
ld: symbol(s) not found for
architecture arm64 clang: error: linker command failed with exit code 1 (use
-v to see invocation)
One of your library miss the target architecture. Try Simulator or another device with difference cpu.
List all available architecture in your library with cmmand 'lipo -info'
eg:
localhost:~ user$ lipo -info /Applications/iTerm.app/Contents/Frameworks/Sparkle.framework/Sparkle
Architectures in the fat file: /Applications/iTerm.app/Contents/Frameworks/Sparkle.framework/Sparkle are: ppc i386 x86_64
You miss an additional '/' in your library search path. it's a bug in Vuforia that there are '\' instead of '/' in the pathnames. Apple (and linux) treats '\' as escape characters in pathnames.
you have : '/LibrariesPlugins/iOS'
right path: '/Libraries/Plugins/iOS'
I created a static library (XXX.a) (which has 3 static libraries inside(aaa.a, bbb.a, ccc.a)) and added it into a pre-developed project (someonesProject). When I lipo -info to XXX.a I see the following architectures: armv7, i386, x86_64, arm64
When I try to run this project, I receive an error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_aaa", referenced from:
objc-class-ref in XXX.a(XXX.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I remove arm64 from the valid-architectures (arm64, armv7 armv7s) of the project (someonesProject), then I can run the app.
How can I fix this issue, I want to make this project work without removing arm64?
I really need help.
Thanks
E.
All your static libraries have to be compatible with arm64 if you want to compile your project with this architecture.
So I guess at least one of aaa.a, bbb.a and ccc.a is not compatible with arm64.
I am developing a fake static framework. I build it and included it another sample application. The sample application is running fine on iPhone(ios 7.1), but it giving below errors when i run it on simulator
ld: warning: ignoring file /Users/awsuser8/Desktop/Test.framework/Test, file was built for archive which is not the architecture being linked (i386): /Users/awsuser8/Desktop/Test.framework/Test
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Test", referenced from:
objc-class-ref 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)
You can rebuild the library for the iOS Simulator and combine it using lipo with the ARM build of the library. Then the library will support x86 builds as well.
i am trying to add this mpos.framework to my Static library but i get this :
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MPMpos", referenced from:
objc-class-ref in libSerenity.a(Widget.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i should add the mpos.framework to the DependentApp also?
i should add the mpos.framework to the DependentApp also? - You can easily answer this by trying it.
My guess is that this is not your problem. It looks like mpos.framework (and its internal library) is not FAT library and is compiled for ARM architecture(s) only. It probably do not contain i386 (simulator) version of the compiled code. You can find more information about FAT libraries here: Build fat static library (device + simulator) using Xcode and SDK 4+
I'm trying to include a static library in an iOS project.
I imported the .a file and every .h related but then I'm getting this error :
ld: warning: ignoring file /Users/alexis/Library/Developer/Xcode/DerivedData/PlazappPartnerWorkspace- cdrmloavlcqouugawmtqywiinqne/Build/Products/Debug-iphoneos/libPlazappPartnerLib.a, file was built for archive which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_LauncherViewController", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I guess there's a problem of architecture type but I don't understand why nor how to solve it.
Can someone explain it to me and tell me how to solve it? Thanks!
It seems your library was built to run in the device (arm architecture) and you try to use it in the simulator (i386 architecture). Check your library build settings. They should match with your project build settings.
Or even better, create a fat library for development purposes. lipo command is your friend.
To verify the current architectures present in your library: (in Terminal)
cd <path to library folder> # in you case: /Users/alexis/Library/Developer/Xcode/DerivedData/PlazappPartnerWorkspace- cdrmloavlcqouugawmtqywiinqne/Build/Products/Debug-iphoneos
lipo -info libPlazappPartnerLib.a
The output should look like:
Architectures in the fat file: libPlazappPartnerLib.a are: armv6 armv7
They should match with the target device or simulator you are building for.