Reputation: 41
I have one Xcode iOS project (I'll call it the super project) which contains another Xcode iOS project as a subproject.
The subproject is an iOS static library. I have done everything described at http://www.blog.montgomerie.net/easy-xcode-static-library-subprojects-and-submodules.
So, the static library is listed as a target dependency under the super project's target's build phases.
The static library is already linked as a binary library in the super project's target's build phases. In a class in the super project, I am able to reference classes in the subproject but when I try to build the super project I get tons of errors for undefined symbols.
These "undefined symbols" are classes in the frameworks that the subproject (static library) depends on. My question is, how do I get the super project build process to be able to locate the header files of the frameworks that the subproject depends on?
I assumed that linking the static library would have handled this unless I'm doing something else wrong. Just for the heck of it, I also tried linking all of the frameworks that the subproject depends on as binary libraries to the super project.
This got rid of all the errors but then the build still failed because it says there were 33 duplicate symbols (because now both projects are linking the same frameworks).
I do not think that the super project should have to link the subproject's framework dependencies. Thanks in advance.
Upvotes: 4
Views: 2160
Reputation: 265
I think your problem is that the superproject do not find all the static library headers when the build fails with tons of "undefined symbols" errors. Have a look in superproject settings panel, under build settings tab. Find "header search paths" and "user header search path" (or something similar) and put inside them the path of subproject headers folder. If you put /** at the end of the path, xcode will search inside all the subfolder of the path. Make sure the "always search user header search path" flag is on/true.
Upvotes: 2