xcode 6 - symbols not found for architecture i386 (zbar) - ios

I have a project which uses the zbar-sdk (a barcode scanning library).
After updating my machine to xcode 6 I am having some trouble.
Please help me solve this.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
objc-class-ref in MenuListViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

you have to import AVFoundation and AudioToolbox frameworks and also set i386 armv6 armv7 armv7s architectures needed for running the libraries

Related

ld: symbol(s) not found for architecture x86_64 Xcode 10.3

I am trying to run a project with objective C and with a private SDK
and I get the error
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_DetectionSDK", referenced from:
objc-class-ref in ViewController.o
objc-class-ref in AppDelegate.o
objc-class-ref in SecondViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is weird (for me) because in the real iphone runs (and in xcode 11), but in the simulator does not
Looks like your private SDK doesn't contains simulator slices.
To check this, run command lipo -i path\to\your_private_sdk\your_private_sdk.
Output should contains something like i386 x86_64 armv7 arm64
% lipo -i your_private_sdk
Architectures in the fat file: your_private_sdk are: i386 x86_64 armv7 arm64
If it contains only armv7 arm64 architectures, you need to create universal framework from your private SDK.
More details you can find here:
How to create universal (fat) library
You can try -
1:) delete the app from simulator , clean and build again.
2:) try to reinstall that private sdk & then .clean and build.

Undefined symbols for architecture armv7: "_OBJC_CLASS_$_MPMusicPlayerController"

Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MPMusicPlayerController", referenced from:
objc-class-ref in liblibPDRCore.a(PGDeviceStatus.o)
ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
One of my lib was manually dragged into project before now I have it installed by cocoapods ,then the problem occurred. And I tried add the MediaPlayer.framework(although I don't need this framework before) to my project,the problem becomes this : ld: 14 duplicate symbols for architecture armv7
Anyone can help me šŸ™?
I had same problem, but then I added MediaPlayer.framework like this

How do I allow all libraries to run on arm64 and armv7?

Iā€™m getting this error:
undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PayTabCardReaderViewController", referenced from:
objc-class-ref in PayViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
PayTabsLibrary.a can only run on armv7, not on arm64. But I have other libraries that run on arm64 so this is why I'm getting the error.
How do I allow all libraries to run on arm64 and armv7?

Undefined symbols for architecture x86_64 while using a static library

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.

Undefined symbols for architecture i386 and symbol not found for architecture i386

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.

Resources