UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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?

2      

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

2      

@ian  

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

2      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Click to save your free spot now

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.