4

I am developing a iOS static library and use CoreLocation and MapKit framework within the static library. Xcode 5 with LLVM 5 has new build setting 'Enable Modules (C and Objective-C)' and 'Link frameworks Automatically'

These settings eliminate the need to add the dependent framework while including the static library in Target application.

However, this seems to be working only if '-ObjC' flag is added to other linker flags, even though the flag is unnecessary as I do not have Objective C categories to be loaded from static library.

You can find a sample project here (http://cl.ly/0Z1i1U1w3C3P) to try this out. Please let me know any suggestions. Is there any interconnection between -ObjC flag and new build setting in LLVM5?

Regarding Sample app:

There are two projects 1. libTest 2. StaticLibApp

Open StaticLib App and libTest is added as its subproject libTest has class libTest.h and .m with a single class method +(void)check. Where I am trying to refer to CLLocation and MKMapView objects.

StaticLibApp compiles fine if the '-ObjC' flag is added to other linker flags, otherwise it raises a compile Error saying CLLocation and MKMapView class symbol not found.

Rahul
  • 12,886
  • 13
  • 57
  • 62
Bharath Booshan
  • 211
  • 2
  • 10

0 Answers0