Eric Nguyen
Eric Nguyen

Reputation: 51

UITest fails with error 'ld: entry point (_main) undefined. for architecture x86_64'

I am new to Xcode and Swift. I just tried to create UITest using swift language. I I get this build failed with the error when I try to run the simple test that just print the "Hello world"::

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

Is anyone having the same issue? I appreciate if you can share how to fix it. BTW I am using Xcode 9.1 and Swift 4

Upvotes: 3

Views: 4494

Answers (1)

Ratnesh Shukla
Ratnesh Shukla

Reputation: 1178

Step to Fix:

  1. Select your Project
  2. Go to Target -> Select your Test target
  3. then go to Build Setting -> Search Mach-O Type
  4. Change to -> Bundle

enter image description here

Upvotes: 11

Related Questions