Created new XCode Configuration and Scheme - linker is suddenly failing

后端 未结 2 1328
萌比男神i
萌比男神i 2021-02-14 17:16

A new XCode project has Debug and Release Configurations. I\'ve added a new one under \"ProjectName > Info\" called \"development\", which is for now a duplicate of \"debug\".

相关标签:
2条回答
  • 2021-02-14 17:24

    The problem is that Xcode will expect to find the libraries inside a folder named after your custom configuration. You can add the custom configuration to each library you use, or better follow the steps below to make it use the libraries built via the Release configuration.

    Steps:

    • Select your target
    • Open Build Settings tab
    • Search for 'Library Search Paths'
    • You'll see your new configuration name alongside Debug and Release
    • Double-click the space next to your new configuration name
    • Enter "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)"
    • Set recursive to true.

    • Exit the dialog and you should see:

    (inspired by this post)

    0 讨论(0)
  • 2021-02-14 17:40

    Xcode 8.3.2 needs a bit different changes.

    To make it work, you need to change the Per-configuration Build Products Path for your custom build config. For example, I have an Internal build config. In that field, instead of $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME), I put $(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME), and now it works :).

    0 讨论(0)
提交回复
热议问题