luckyruby1
luckyruby1

Reputation: 51

XCode 12.3 ld: entry point (_main) undefined. for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld: entry point (_main) undefined. for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It was building and running with the simulator the day I created the project. But now, it does not build.

The app project does not contain a AppDelegate file. I heard on recent versions of XCode (12.3), that the file is not needed. Should I create one and if so how?

Any suggestions?

Upvotes: 1

Views: 3754

Answers (2)

Samuel Folledo
Samuel Folledo

Reputation: 493

If your project is in SwiftUI, it is probably the inconsistency of not having an App swift file or a SceneDelegate file that serves as an entry point of your app.

If your project does not have a SceneDelagate.swift file, it should at least have an App file which looks something like belowenter image description here

Upvotes: 1

Wicus Fourie
Wicus Fourie

Reputation: 21

I have found that deleting the derived data folder found under preferences usually solves unexpected / unexplained Xcode errors. Before you delete the folder, quit Xcode and then start again afterwards.

Upvotes: 0

Related Questions