3

I am getting error when archiving (for release)

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

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

Any help will be appreciated.

Manimaran
  • 567
  • 1
  • 10
  • 30
Prachi Rajput
  • 502
  • 1
  • 8
  • 20

5 Answers5

7

My Issue was this:
Somehow my "main.m" got removed from "Compiler Source" in my Project Settings/Target.
Adding it back, SOLVED it.

Saru
  • 863
  • 1
  • 15
  • 23
3

Finally after a lot of tries I got the answer, the problem was related to private path, as there should be a public path for 3rd party library.

Prachi Rajput
  • 502
  • 1
  • 8
  • 20
0

check in your build settings is like in this picture, if its not then update your code setting like this, this pic is take from my project which is working perfectly

Manimaran
  • 567
  • 1
  • 10
  • 30
0

I have found solution for your problem, you don't have main.m method, create it like this,

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}
Manimaran
  • 567
  • 1
  • 10
  • 30
  • @PrachiRajput http://stackoverflow.com/questions/7976516/not-able-to-build-my-project-on-xcode-4-2 Try this.. – Manimaran Feb 12 '14 at 11:25
  • I couldn't understand why it is working for archiving in debug mode. – Prachi Rajput Feb 12 '14 at 11:36
  • Solved my problem. I, too, already had a main.m but it was not in (Project Overview -> Targets -> Build Phases -> Compile sources). Readded and everything works fine again! – fat32 Feb 24 '15 at 19:23
0

In my case, changing the iOS Development Target to the min version of the Xcode supported resolved this issue, see image: enter image description here It was 5.0, which is far lower than the Xcode 13's min supported version, which is 9.0. Changing it to iOS 9.0 worked well.

Honghao Z
  • 1,419
  • 22
  • 29