Linux下Eclipse編譯時,報recompile with -fPIC錯誤,解決方法

 

Linux下Eclipse編譯時,報recompile with -fPIC錯誤,解決方法

今天編譯一個包含有sqlite3.c的工程時報告

relocation R_X86_64_32 against `‘。rodata' can not be used when making a shared object; recompile with -fPIC

錯誤。解決方法是:右鍵Eclipse工程,propertise->c/c++ build->settings->GCC C Compiler->Command: 

gcc 後面加上-fPIC,重新編譯,解決。

發佈了4 篇原創文章 · 獲贊 4 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章