我有一个项目,我使用 -lcblas 标志链接到 BLAS 库。它曾经编译得很好,直到将我的系统升级到 Ubuntu 18.04 和 GCC 7.3.0 之后。无论如何,编译命令是
g++ -o @$ benchmark.o mine.o -lcblas
这会产生错误
/usr/bin/x86_64-linux-gnu-ld: benchmark.o: relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
这个问题可能是重复的,但我无法将解决方案翻译为与我的问题类似的其他问题。