Reputation: 11605
I'm getting this error when building in Xcode for iOS.
Undefined symbols for architecture i386:
"_CGRectInset", referenced from:
-[RootViewController viewDidLoad] in RootViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The app is a clean project, just built from the template Xcode provides.
Any ideas?
Upvotes: 5
Views: 5923
Reputation: 28094
I had the same problem with a project created from "Page-Based Application" template, in XCode4 Developer Preview 5.
You can fix it by adding the CoreGraphics framework to the list of linked frameworks and libraries. In other words:
Then it builds and runs.
Upvotes: 4
Reputation: 7510
This may be due to the project not being linked to the correct libraries. It may also be that there are missing Frameworks on your SDK installation. In the Build Phases section, make sure that your app is linking with UIKit and CoreGraphics. Also, it may help to also add the QuartzCore Framework, although I doubt that that is needed.
Upvotes: 2