How to add static libraries inside a C++ project with Xcode

Deadly 提交于 2019-11-28 10:00:42
t.niese

Target dependencies is used if your static library is created by another XCode project and you want to include this project, so that you can easily develop on both you library and the corresponding application.

If you want to include a foreign library you would select your target under TARGETS there you select the section Build Phases there you have the area Link Binary With Libraries into this area you would add your library either with drag & drop or with the + sign.

To add the include path you select your project under PROJECT there you select the area Build Settings there you have under Search Path the Points Header Search Paths this should include the path to the directory where the header is.

The difference between the settings in Project or Targets is that in Project it sets the default settings for all targets. In Targets you can change the settings per Target.

EDIT For the linking errors this two answers could be helpful:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!