I am not unable to build and run the demo projects for iOS which are included in the SDL download. I am getting the error below and don't know how to resolve this issue. On my simulator, the project is compiling but the sample projects are not running on my iPhone. I am using iOS 7 beta 3 on both of them (simulator & iphone).
The following build error occurs:
ld: entry point (_main) undefined. for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In addition, the sample program includes a main function, so shouldn't it work normally?
Related
I'm fairly new to Xcode and have no idea why my build failed. The following is a part of the output, the parts that I omitted are just warnings about deprecations.
ld: building for iOS Simulator, but linking in object file built for iOS, file '/Users/user/Documents/GitHub/bus/ios/Pods/GoogleMaps/Maps/Frameworks/GoogleMapsCore.framework/GoogleMapsCore' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in parallel
Could not build the application for the simulator.
Error launching application on iPhone 13.
Exited (sigterm)
What can I do to fix this issue? I have no issues building my app in android.
It works against an iOS 14.4 simulator and Google Maps appear on the app correctly.(M1 machine)
My app works perfectly fine when building and running it on both the simulator and my physical device running iOS 15. However, when I go to archive it in preparation for the App Store, I get the following error:
ld: entry point (_main) undefined. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I did rename the app and some of the folders, but I made sure that all paths in the project build settings were updated to reflect these changes.
The app is SwiftUI, and I use no AppDelegate (some other answers refer to missing #UIApplicationMain). There is also a Widget extension - but I see #main used in their respective App/Widget classes.
Environment details:
Xcode 13 (RC)
iOS 15 (RC) on both simulator and physical iPhone X device
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I run on normal physical device, the app runs. But on the simulator i get that error.
I visit the folders Debug-iphoneos( where everything is there) but in Debug-iphonesimulator I don't see AFNetworking.
I am facing this issue after upgrading to xcode 12.
Edit: Issue happened after updating to xcode 12, and target from 8.0 to 10.0
I am having issues running my application on different devices via XCode. If I test with my iPhone, which is running iOS 9.0.2, it runs fine. However, when I run on iPads running anything between 7.0.4 and 8.4, I get the error:
Apple Mach-O Linker Error
ld: can't link with a main executable file '/Users/ttseng/Library/Developer/Xcode/DerivedData/spin-alycjhujfjocfeaggybdmvitcjxx/Build/Products/Debug-iphoneos/spin.app/spin' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My iOS Deployment Target is iOS 7.0.
How do I resolve this issue?
Things I've tried based on other posts I've seen on StackOverflow:
Ensured there are no duplicate implementation files listed under Build Phases > Compile Sources
Ensure there are no missing implementation files from Build Phases > Compile Sources
Clean Project
It was an issue with the tests that were automatically generated when I created the app. I had to follow the directions here after selecting my test target:
can't link with a main executable file
So my iOS project was working fine, then all of a sudden I am getting the following error when I try to run in simulator:
ld: framework not found AVKit for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And when I try to archive I get this error:
ld: framework not found AVKit for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
From what I can tell, AVKit is an OSX framework and not an iOS framework.
So why is my project suddenly confused and wanting an OSX framework, and do I convince it that it does not need it?
Well apparently AVKit is available in the iOS 8 SDK so I need to upgrade Xcode to version 6 in order to add it.
See this question: Need help: 'Wrong Architecture' causing app to crash when launching in iOS 7 but works fine in iOS 8
And it should be set as an Optional framework if you want to support iOS 7 and below as well.