【问题标题】:What means: libtool: -dynamic not specified the following flags are invalid: -ObjC什么意思:libtool:-dynamic未指定以下标志无效:-ObjC
【发布时间】:2011-05-18 02:49:02
【问题描述】:

我继承了一个依赖于静态库的项目(我很幸运!)。尝试构建静态库,我收到此错误:

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC 

后面是这两行,我确实理解,但这似乎是一个单独的问题(缺少文件。)

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lFlurryWithLocation
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lFlurryWithLocation is not an object file (not allowed in a library)
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool failed with exit code 1

我错了吗,这都是相关的吗?如果我修复丢失的文件部分,第一行错误会消失吗?

无论哪种方式,消息中的-dynamic not specified 部分是什么意思?

谢谢!

【问题讨论】:

  • 你能告诉我们你传递给 libtool 的参数吗?
  • 在 iPhone 开发中,许多第 3 方库要求您添加链接器标志 -ObjC 作为项目构建设置。 (段落)我在这个项目上摆弄了一段时间,神奇地,错误消失了。我真的不能说我做了什么,对不起。不过,我很想从了解 libtool 内部 gerwerkkens 的人那里知道-dynamic not specified 位的含义!

标签: iphone linker static-libraries


【解决方案1】:

Olie,你最初的预感是正确的。两条消息之间没有关系。第一条消息“-动态未指定以下标志无效:-ObjC”只是一个警告。构建静态库不需要 -objC 选项。

【讨论】:

  • -1 这不是警告,它实际上是一个错误,会阻止成功构建。
  • 如果我说警告与错误无关可能会更好。
猜你喜欢
  • 1970-01-01
  • 2015-06-28
  • 2022-01-14
  • 2014-07-04
  • 2014-06-04
  • 2014-02-27
  • 2020-09-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多