Xcode静态库错误:未知选项字符`f': - fobjc-link-runtime

时间:2021-01-26 04:52:20

I try to build a static library which "Implicitly link Objective-C Runtime Support", but build fail at link step with the next message: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character 'f' in: -fobjc-link-runtime

我尝试构建一个“隐式链接Objective-C运行时支持”的静态库,但是在链接步骤中使用下一条消息构建失败:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ libtool:未知选项字符'f': - fobjc-link-runtime

I have no idea why this happens, so if you know please help me.

我不知道为什么会这样,所以如果你知道请帮助我。

1 个解决方案

#1


1  

The libtool command doesn't take a -fobjc-link-runtime argument to it. It sounds like this erroneously snuck into your Xcode project. I would suggest the following:

libtool命令不会对其使用-fobjc-link-runtime参数。听起来这错误地隐藏在你的Xcode项目中。我建议如下:

  1. Open Xcode
  2. 打开Xcode
  3. Select your project and the Build Settings tab
  4. 选择项目和“构建设置”选项卡
  5. In the Search box type in -fobjc-link-runtime and there should be at least one line in the Build Settings that corresponds
  6. 在“搜索”框中键入-fobjc-link-runtime,并且“构建设置”中至少应有一行对应
  7. It the item isn't on a compiler-related line, try removing it and re-building
  8. 它不在编译器相关的行上,尝试删除它并重新构建

If you don't find it, then it sounds like the libtool arguments are somehow unexpectedly including the arguments from the compiler.

如果你没有找到它,那么听起来像libtool参数在某种程度上意外地包括编译器的参数。

If this is the case, which version of Xcode, and which compiler are you using?

如果是这种情况,您使用的是哪个版本的Xcode,以及哪个编译器?

#1


1  

The libtool command doesn't take a -fobjc-link-runtime argument to it. It sounds like this erroneously snuck into your Xcode project. I would suggest the following:

libtool命令不会对其使用-fobjc-link-runtime参数。听起来这错误地隐藏在你的Xcode项目中。我建议如下:

  1. Open Xcode
  2. 打开Xcode
  3. Select your project and the Build Settings tab
  4. 选择项目和“构建设置”选项卡
  5. In the Search box type in -fobjc-link-runtime and there should be at least one line in the Build Settings that corresponds
  6. 在“搜索”框中键入-fobjc-link-runtime,并且“构建设置”中至少应有一行对应
  7. It the item isn't on a compiler-related line, try removing it and re-building
  8. 它不在编译器相关的行上,尝试删除它并重新构建

If you don't find it, then it sounds like the libtool arguments are somehow unexpectedly including the arguments from the compiler.

如果你没有找到它,那么听起来像libtool参数在某种程度上意外地包括编译器的参数。

If this is the case, which version of Xcode, and which compiler are you using?

如果是这种情况,您使用的是哪个版本的Xcode,以及哪个编译器?