XCode 4.2 and Using a Static Library Causing Problems

后端 未结 2 840
长发绾君心
长发绾君心 2020-12-09 04:59

Like many others here SO, I am having issues using libraries in my XCode workspace. The idea is I have my main project (MyApp) and two libraries (lib1

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 06:00

    1. Open Main Project where you would like to add static library.
    2. Save as workspace.
    3. Add library's project package. No need to check copy while adding project package.
    4. Update Xcode preferences location to Custom-Relative to Workspace. Products as 'Build/Products' and Intermediates as Build/Intermediates
    5. In your Main project -> target -> build settings, Add Header and Library Search Path as $(BUILD_PRODUCTS_DIR)
    6. Build Library Project. So a new library will be created in mentioned build path.
    7. Remove existing library from Build Phases and move to trash. Open Build Phases -> Link Binary With Libraries and add newly created library from build directory.

提交回复
热议问题