XCode "Other Linker Flags" c++ and subprojects

Viewed 73

I have an XCode project that references other XCode projects inside of it. These referenced XCode projects are libraries, that I am loading in the root project (which is an app) and depends on these libraries (I just add the ".framework" files from these subprojects into the App Target's Frameworks list). This allows me to debug and step through the code of the libraries when debugging my app.

Some of these libraries are written in C/C++ and use standard libraries such as string, stdio, etc. As such, I need to add the following "Other Linker Flags" option to the Build Settings.

-lc++ -ObjC -lc

Some of these libraries do not use C/C++ and build just fine by themselves without these flags.

However, if I try to build the root project (app), linking fails for the subprojects with errors such as

symbol not found: _memcpy

It seems as if one subproject needs these flags to build, I need to add these flags to all other subprojects and the root project itself. This is not ideal.

Does anyone have an explanation for this, or a workaround that doesn't require me to add these linked flags to the subprojects? For example, adding a "global" linker flags setting to the entire project.

0 Answers
Related