python - `gcc`哪个版本支持 `--no-undefined`开关?

标签 python c gcc linker nifti

我正在尝试从源代码编译 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 是一个有效的开关。

最佳答案

这个开关是一个linker option对于 ld。它不是 GCC 的直接部分,而是仅封装在 -Wl 选项中以传递给链接器(您似乎有 --Wl这是错误的)。

编辑: Yugr 指出了不正确的 --Wl 选项,他值得部分功劳!

关于python - `gcc`哪个版本支持 `--no-undefined`开关?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41872154/

相关文章:

c - 头文件原型(prototype)中的未知类型名称

缓存对齐数组元素

c++ - 当我用 gcc 替换 g++ 时,为什么我的 makefile 失败了?

Python 将 Json 行加载到 Pandas Dataframe

c - 奇怪的行为 - 获取 GDT @ 内联程序集

python - Spyder 控制台上的停止按钮在 Windows 和 Python 3.7 上不起作用

c - 对 memset 的 undefined reference

c - 为什么我的for循环不遍历我的char_array?

python - 组织文件并将其复制到新文件夹

python - 如何访问方法的属性