發表文章

目前顯示的是 5月, 2017的文章

gcc 編譯錯誤

1: 錯誤: recompile with -fPIC [1] ... [ 14%] Linking CXX shared library ../lib/libvgltrans_test2.so /usr/bin/ld: /opt/libjpeg-turbo/lib64/libturbojpeg.a(libturbojpeg_la-jdmarker.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/libjpeg-turbo/lib64/libturbojpeg.a(libturbojpeg_la-jdmarker.o)(.text+0xa0c): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17' /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status ... Makefile:127: recipe for target 'all' failed make: *** [all] Error 2 解決: 以上述例子, 從新編譯此套件所需的libturbojpeg. 在編譯過程加入 -fPIC Reference recompile with -fPIC