BLACK FRIDAY SALE: Save 50% on all my Swift books and bundles! >>

Day 37 - Building a list we can delete from - Build Error [Entry point (_main) undefined. for architecture x86_64]

Forums > 100 Days of SwiftUI

@ian  

Hi there, I have having a problem with compiling the first part of this lesson at this point: https://youtu.be/2g1t15bwX44?t=337

I am recieving a Entry point (_main) undefined. for architecture x86_64 error.

I tried to add @main to my ContentView.swift code but that produced more errors.

All of the solutions to this error I can find online see to be for older versions of XCode / Swift.

I am trying to build foriPhone SE 3rd GenusingXCode 14.1 running Ventura 13.0.1 (22A400) on a MacBook Air Retina, 13-inch, 2020

Any ideas how to track this down? Thanks.

EDIT:

If I download project 7 from https://github.com/twostraws/HackingWithSwift there is a file in the project called iExpense.swiftthat contains:

import SwiftUI

@main
struct iExpenseApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

When I add this file and code to my project it compiles.

However this doesn't seem to be in the tutorials at least not the first video? Or have I missed something?

   

when you created a new project did you delete any files? if you did you shouldnt, make a new project and follow the tutorial in ContentView. lmk if i understood badly

   

@ian  

@Nanometer54 I don't believe I deleted anything. But I did get it working after adding the needed file / code.

   

Hacking with Swift is sponsored by Guardsquare

SPONSORED AppSweep by Guardsquare helps developers automate the mobile app security testing process with fast, free scans. By using AppSweep’s actionable recommendations, developers can improve the security posture of their apps in accordance with security standards like OWASP.

Learn more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.