I m splitting up an Xcode iPhone project into multiple smaller projects for code reuse. The structure looks like this:
+------------+
| App |
+------------+
|
+------------------+
| |
+--------------+ +--------------+
| Static Lib A | | Static Lib B |
+--------------+ +--------------+
| |
+----------------+
|
+--------------+ +----------------+
| Static Lib Z |--| Static Lib KAL |
+--------------+ +----------------+
Everything compiles correctly, but as soon as the app is linked, the linker cannot find 2 symbols of the KAL (the open source calendar lib) library. Each library has a cross-reference and all the archives are added to the "Link binary with libraries" build phase.
错误是:
Undefined symbols:
"_OBJC_CLASS_$_KalViewController", referenced from:
objc-class-ref-to-KalViewController in libA.a(AViewController.o)
"_OBJC_CLASS_$_KalDate", referenced from:
objc-class-ref-to-KalDate in libA.a(AViewController.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
I m using a class from LibZ in LibA s AViewController which in his turn is using a class in LibKAL.
PS:A和B的分离只是因为并非所有上诉机构都需要两个机构提供的功能。