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 !
Most of the core iOS and MacOs software is still written in Objective-C, though Apple is pushing for new updates to be written in Swift.
Objective-C is an object-oriented programming language used by Apple since the 90. It combines the advantages of two earlier languages - C and Smalltalk. In 1996 Apple overtook NeXT, which developer tools would use Objective-C. These tools were later included in Xcode.
Overview of Objective-C Objective-C is the programming language that is used to write applications for Apple's iOS and OS X operating systems. The Objective-C programming language is based on C, but it adds support for object-oriented programming. All Objective-C programming is done with the Foundation framework.
You can use XCode IDE to develop iOS and OS X apps in both Objective-C and Swift. XCode provides everything you need to build a performant app from SDKs, APIs, frameworks, and compilers, to pre-build development libraries, etc.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With