ubuntu系統下,gsl 庫鏈接問題 -undefined reference to `cblas_xxx`


  今天在ubuntu系統下進行程序調試的時候出現以下錯誤信息:

[ 10%] Linking CXX executable ../test_coco
/usr/local/lib/libgsl.so: undefined reference to `cblas_ztrsv'
/usr/local/lib/libgsl.so: undefined reference to `cblas_scasum'
/usr/local/lib/libgsl.so: undefined reference to `cblas_izamax'
/usr/local/lib/libgsl.so: undefined reference to `cblas_dnrm2'
/usr/local/lib/libgsl.so: undefined reference to `cblas_zdotc_sub'

collect2: error: ld returned 1 exit status
make[2]: *** [test_coco] Error 1
make[1]: *** [src/CMakeFiles/test_coco.dir/all] Error 2
make: *** [all] Error 2

  可以看出,之前的編譯都沒有問題,在最后的鏈接階段出現錯誤,根據提示可知,libgsl庫鏈接相關文件的時候出現問題。libgsl庫依賴clbas庫中的相關文件。所以在鏈接gls后還需加上對gslcblas的鏈接,問題解決!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM