![gfortran make 오류: "- -fPIC로 다시 컴파일"](https://rvso.com/image/1000376/gfortran%20make%20%EC%98%A4%EB%A5%98%3A%20%22-%20-fPIC%EB%A1%9C%20%EB%8B%A4%EC%8B%9C%20%EC%BB%B4%ED%8C%8C%EC%9D%BC%22.png)
포트란 프로그램을 컴파일할 때 오류가 발생했습니다. 제공된 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에 추가했지만 둘 다 작동하지 않았습니다.
도움을 주시면 감사하겠습니다.