I keep getting errors upon building my application on Xcode:
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
None of my code is erroring and the errors are weird errors and anything I do does not resolve it. I don't think the code is relevant to the issues because it isn't referenced in the error.
This is a screenshot of the error.
The linker has not been able to find any file in the linking process with the main swift entry point. This can be due to the file not existing at all in your project, or that it exists but has not been included in the compile or link build phases.
In Swift, the main swift entry point is defined in a main.swift
module, or (for iOS) in the AppDelegate.swift
file there needs to be a @UIApplicationMain
declaration. I don't see a Compile main.swift
in your log, perhaps its missing or not included in the build phases?
Just in case, check if your AppDelegate
app target is selected on the File Inspector.
( Select AppDeletage
> Show the Utility
> Show the file Inspector
> under Target Membership
, select your target.)
It happened to me after renaming an existing file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With