Xcode should help add system framework when its header is imported

Originator:dempsey
Number:rdar://13385752 Date Originated:09-Mar-2013 11:11 AM
Status:Closed Resolved:Duplicate/12645158
Product:Developer Tools Product Version:Version 4.6 (4H127)
Classification:Enhancement Reproducible:Not Applicable
 
Xcode and LLVM is excellent at finding issues in code, allowing me to fix them before I compile.

But, currently if I import a system header but forget to add the framework to the project, the result is a build error that can be confusing, especially for a new developer:

"Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_MKAnnotationView", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)"

It would be great if Xcode could notice that a system header is being added to the code, and if the matching framework is not included in the project, give the user an easy way to add the framework.

This could possibly be similar to how Xcode will give project-level warnings about changing build settings to match new Xcode defaults, and give the ability to make the appropriate change.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!