【问题标题】:Which version of `gcc` supports the `--no-undefined` switch?哪个版本的 `gcc` 支持 `--no-undefined` 开关?
【发布时间】:2017-06-11 20:19:53
【问题描述】:

我正在尝试从源代码编译 pynifti 包(涉及 Anaconda Python 发行版的长篇故事)。

运行make后,我收到以下错误:

 gcc: error: unrecognized command line option ‘--Wl,--no-undefined’

确实,手册 (man gcc) 没有包含有关 --no-undefined 开关的信息。我的gcc 版本是4.8.5。另外,我在https://gcc.gnu.org/onlinedocs/gcc/Option-Index.html#Option-Index 中找不到no-undefined 选项

但是,从Force GCC to notify about undefined references in shared libraries 我推断它至少对于某些版本的gcc 来说是一个有效的开关。

【问题讨论】:

  • 执行:s/--Wl/-Wl/
  • 谢谢,它正在工作;我讨厌修复第三方代码

标签: python c gcc linker nifti


【解决方案1】:

此开关是linker optionld。它不是GCC 的直接一部分,但它只封装在-Wl 选项中以传递给链接器(您似乎有--Wl 这是错误的)。

编辑: Yugr 指出了不正确的--Wl 选项,因此他值得称赞!

【讨论】:

  • 不幸的是,@Yugr 没有提供我可以接受或赞成的答案。 :-(
  • @abukaj Gerhardh 的回答基本上是完整的,所以没关系。
猜你喜欢
  • 2018-04-27
  • 2011-06-14
  • 1970-01-01
  • 1970-01-01
  • 2021-03-26
  • 2020-01-05
  • 2011-09-28
  • 1970-01-01
  • 2013-01-28
相关资源
最近更新 更多