Reputation: 71
I create a new app project(not library or framework), and then I set "compile source as" as object-C++.But when I compile the source, it shows “build failed”.
The error is :
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_UIResponder", referenced from:
_OBJC_CLASS_$_AppDelegate in AppDelegate.o
"_OBJC_METACLASS_$_UIResponder", referenced from:
_OBJC_METACLASS_$_AppDelegate in AppDelegate.o
"_UIApplicationMain", referenced from:
_main in main.o
"_OBJC_METACLASS_$_UIViewController", referenced from:
_OBJC_METACLASS_$_ViewController in ViewController.o
"_OBJC_CLASS_$_UIViewController", referenced from:
_OBJC_CLASS_$_ViewController in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
but what makes me confused is that : if it is a framework project,it compiles well. Could you lend me a hand !
Upvotes: 5
Views: 2063
Reputation: 104698
Your app's missing symbols from UIKit. You need to link your app to UIKit:
Once that is completed, there may be new link issues which are discovered.
Upvotes: 18