I built a small game using SDL2, SDL2_ttf, and SDL2_mixer. I ported it to Xcode and was able to run it with the iOS simulator just fine. I successfully built all of the SDL2 libraries with the target set to "iOS Device" and imported them into the Frameworks directory of my project. However, when I tried to archive the project with the target set to "iOS Device" I get the following error:
ld: entry point (_main) undefined. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is this issue casued b7 the SDL libraries I'm trying to link to or is it something else entirely?
I bet the SDL lib doesn't contain a valid armv7 slice but your app is being built for arm7 and arm64.
Check the SDL build settings and make sure that the 'valid architectures` include armv7
Related
Trying for several days to build my flutter project in iOs (flutter build IPA) and I always seem to receive the same errors :
"_objc_msgSend$setIOSHasWarnedLocationServicesOff:", referenced from:
+[LocationAuthorization run:onCancel:] in TSLocationManager(LocationAuthorization.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There are a lot of them so I won't be putting all of them here but they're all related to _objc_msgSend$ and TSLocationManager.
I tried to add "-lc++" to Other Linker Flags in Build Settings (Runner Target)., related to this issue https://github.com/facebookarchive/pop/issues/25 but it still failing with more than 100 _objc_msgSend$ issues. I have frankly tried so many things and I'm quite out of clues.
Something I remarked is that when I build from Xcode (Product -» Build), it builds fine when I choose the Destination Device iPhone SE 3rd GEN, but I get the errors when the destination device into my physical device (which is plugged into my Mac).
When I hit flutter build IPA, it always fails.
^_^
First you can update your xcode to version14.0 above.
And the real reason is Apple Clang new optimization scheme._objc_msgSend stup support is not support on xcode13.
If you don't want upgrade your xcode version . You can follow next steps to change your private framework.
I guess you compiled a framework in xcode14 and then used it in xcode13
hh , now i saw you reply , make sure my answer
i'm using Xcode 13.4.1 and it's not having ARCHS_VALID as a build setting #editix –
Bertrand Gélinas
22 hours ago
By default, the clang in Xcode 14 will generate target files that cannot be understood by earlier native linkers.
In the future, it will be recommended to use Xcode14 and above for application package.
If you have private framework build by Xcode14.
Just add -fno-objc-msgsend-selector-stubs to your framework project target build settings other c flags, and build again, replace new framework to your other xcode project
or in your framework project chaneg your podspec file add xcconfig other c flags -fno-objc-msgsend-selector-stubs
or your own script build framework , you can before call xcodebuild command add a change , like thisxcodebuild -project xxx.xcodeproj build OTHER_CFLAGS="-fno-objc-msgsend-selector-stubs "
click on your target > build settings > VALID_ARCHS > and add the following :
arm64 arm64e armv7 armv7s x86_64
in case you didn't find the VALID_ARCHS do the following:
1- Click on the plus sign under the Build Settings.
2- Choose "Add user-defined settings" and it will add NEW_SETTING to you.
3- Rename the "NEW_SETTING" to "VALID_ARCHS" and add the following builds:
arm64 arm64e armv7 armv7s x86_64
if nothing fixed your issue please follow this you may find working answer:
Undefined symbols for architecture arm64
I am trying to include MumbleKit as a library instead of having to compile it each time by following the suggestion of a member of this forum. Yet when I try to compile on the simulator I get:
missing required architecture x86_64 in …libMumbleKit.a (3 slices)
I think I added all the necessary versions to MumbleKit before generating the library:
arm64 armv7 armv7s armv7k arm7s x86_64 i386
notwithstanding, when I execute:
lipo -info libMumbleKit.a
I get:
Architectures in the fat file: libMumbleKit.a are: armv7 armv7s arm64
as well as configuring Build Active Architecture to NO.
I generated the library for MumbleKit both using the Generic iOS device and a iOS 9 physical device.
When I try to archive using the Generic iOS Device option after having extracted the Mumble library in the same way, I instead get error:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
armv7
Same when using my physical device after also generating the library in the correspondent way:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
arm64
And finally the installation on my iOS 9 iPhone 6S went fine with just the same contents in the warning:
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(CryptState.o)' was
built without full bitcode. All object files and libraries for bitcode
must be generated from Xcode Archive or Install build for architecture
arm64
CryptState.cpp if a c++ file in the library.
Check architectures it has with lipo tool. Open terminal, navigate to folder where your library is and do:
lipo -info yourlib.a
If you don't have x86_64, than you should find/compile lib that will have it.
x86_64 is an architecture for Simulator, not for generic iOS device.
I applied the suggestion at:
Xcode 7 'CrashReporter does not contain bitcode' linker error
by adding option -fembed-bitcode to the other linker flags field. And now the problem has moved to a c file: band.c, notwithstanding of course I have added this option for the c and c++ files.
ld: bitcode bundle could not be generated because
'/Users/fbartolom/Documents/cocoa
applications/inArrivoHD/MumbleKit/libMumbleKit.a(bands.o)' was built
without full bitcode. All object files and libraries for bitcode must
be generated from Xcode Archive or Install build for architecture
arm64
What might be still missing?
I aborted the attempt. There must be something faulty in the original mumble kit project not allowing to import its library into another project, or I do not know how to do it anyway.
I've downloaded the Facebook SDK, and gotten it to work on the simulator to post from my app, but it won't even compile on my device.
clang: error: no such file or directory: '/Users/justking14/Library/Developer/Xcode/DerivedData/Descover-fqkbngyllggoxkcskmhhzgmkffxe/Build/Products/Debug-iphoneos/libPluginFacebook.a'
clang: error: no such file or directory: '/Users/justking14/Library/Developer/Xcode/DerivedData/Descover-fqkbngyllggoxkcskmhhzgmkffxe/Build/Products/Debug-iphoneos/libPluginProtocol.a'
libPluginFacebook.a and libPluginProtocol.a are in red in the Link Binary with Libraries, and when I remove them it still won't compile saying
ld: file is universal (4 slices) but does not contain a(n) armv7s slice: /Users/justking14/Desktop/IR/cocos2d/plugin/plugins/facebook/proj.ios/sdk/FacebookSDK.framework/FacebookSDK file '/Users/justking14/Desktop/IR/cocos2d/plugin/plugins/facebook/proj.ios/sdk/FacebookSDK.framework/FacebookSDK' for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The FacebookSDK you use doesn't have machine code for the architecture armv7s
That architecture WAS top of the line but now, apps mostly only use armv7 and arm64
Change your app build settings to only use those architectures (just use the default)
I am trying to use the Worklight 6.1.0.1 Objective C libraries from Objective C code to call the Worklight adapter.
I continue to get compile errors when I reference the libraries in my code and add libWorklightStaticLibProject.a to my project and compile for my iOS 7.1 iPhone5 phone (armv7s architecture).
The compiler error is:
ld: file is universal (2 slices) but does not contain a(n) armv7s slice: /Users/uname/dev/acct/cordova/platforms/ios/WorklightSDK/libWorklightStaticLibProject.a file '/Users/uname/dev/acct/cordova/platforms/ios/WorklightSDK/libWorklightStaticLibProject.a' for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have included the .a file in my list of libraries. My deployment target OS is iOS 5.1.1. Build Active Architecture (for debug) is set to YES. Valid architectures are arm64, armv7, and armv7s.
If I remove armv7s I cannot build for the current architecture (armv7s). If I build for armv7s I get this warning that the Worklight libraries do not contain a slice for the armv7s architecture.
The armv7s architecture is not supported by IBM Worklight at this time.
This is true to all Worklight versions up to Worklight 6.1.0.x.
You can take a look at the Xcode project architecture configuration of a new app with the iPhone/iPad environment for a correct and working architecture configuration.
I made the app in Xcode 4.6 and tested in device. The app is made for both iPhone and iPad. When I try to archive it to make .ipa file, I get this error :
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/admin/Desktop/appName/appName/libzbar.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to set the architecture for this in Build Settings? Or is there some different issue?
libzbar.a library needs to be built for armv7s architecture. If you cannot do that (because you don't have source code for this library) than you should remove armv7s from valid architectures.
You can change valid architectures by following steps:
select project name from the Project Navigator
select project target
open Build Settings tab
change valid architectures field