【发布时间】:2020-10-08 04:08:22
【问题描述】:
在 64 位机器上使用 Python3.7 构建库时出现以下链接错误。
/usr/bin/ld: /usr/local/lib/libpython3.7m.a(ceval.o): relocation R_X86_64_PC32 against symbol `_PyRuntime' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
在同一台机器上,如果我安装一个 miniconda https://docs.conda.io/en/latest/miniconda.html [Py 3.8 for 64bit],该库在该 conda 环境中安装良好,没有任何错误。
我尝试通过添加来构建 Py3.7
export CFLAGS="$CFLAGS -fPIC"
但是,python3.7 的错误仍然存在
【问题讨论】:
标签: python c python-3.x python-3.7