创建了新的XCode配置和方案 - 链接器突然失败 [英] Created new XCode Configuration and Scheme - linker is suddenly failing

查看:178
本文介绍了创建了新的XCode配置和方案 - 链接器突然失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的XCode项目具有调试和发布配置。我在ProjectName> Info下添加了一个名为development的新版本,现在是debug的副本。

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".

我想创建一个新的在开发模式下构建应用程序的方案,所以我复制了Projectname方案,并将其命名为DevelopmentScheme。

I wanted to create a new scheme for building the app in development mode, so I duplicated the "Projectname" scheme and named it "DevelopmentScheme".

我为run和set设置了构建配置存档到我创建的新开发配置。

I set the build configuration for "run" and "archive" to the new "development" configuration that I created.

我仍然可以构建原始方案。

I'm still able to build the original Scheme.

当使用开发方案配置项目时,我也能够构建所有必需的库,但是当我进入链接阶段时,我收到错误:

I'm also able to build all of the required libraries when the project is configured with the development scheme, but when I get to the linking phase, I get the error:


ld:找不到-lRNCookieManagerIOS的库
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

对于iOS开发来说相对较新,我不确定问题是什么。既然我复制了所有内容,那么这不应该意味着它们的行为方式相同吗?关于原始方案和新方案之间可能有什么不同的想法?

Being relatively new to iOS development, I'm not really sure what the issue could be. Since I duplicated everything, shouldn't that mean they behave in the same way? Thoughts on what might be different between the original and new schemes?

推荐答案

问题是Xcode会期望在里面找到库以自定义配置命名的文件夹。您可以将自定义配置添加到您使用的每个库中,或者更好地按照以下步骤使其使用通过Release配置构建的库。

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.

步骤:


  • 选择目标

  • 打开构建设置选项卡

  • 搜索'库搜索路径'

  • 您将看到新的配置名称以及调试和发布

  • 双击新配置名称旁边的空格

  • 输入$(BUILD_DIR)/ Release $(EFFECTIVE_PLATFORM_NAME)

  • 设置递归为真。

  • 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.


  • 退出对话框,您应该看到:

灵感来自这篇文章

这篇关于创建了新的XCode配置和方案 - 链接器突然失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆