![gfortran make 錯誤:“- 使用 -fPIC 重新編譯”](https://rvso.com/image/1000376/gfortran%20make%20%E9%8C%AF%E8%AA%A4%EF%BC%9A%E2%80%9C-%20%E4%BD%BF%E7%94%A8%20-fPIC%20%E9%87%8D%E6%96%B0%E7%B7%A8%E8%AD%AF%E2%80%9D.png)
我在編譯 Fortran 程式時遇到錯誤:因為我提供了 makefile,所以我在終端機中開啟工作目錄並輸入make
.不幸的是我收到這個錯誤:
relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
makefile:43: recipe for target '<name>' failed
實際上我不知道如何“用-fPIC重新編譯”。
我嘗試輸入make -fPIC
並添加類似的內容:
CFLAGS = -fPIC
CXXFLAGS = -fPIC
到 makefile,但兩者都沒有工作。
如有任何幫助,我們將不勝感激,謝謝。