ubuntu系统下,gsl 库链接问题 -undefined reference to `cblas_xxx`

  今天在ubuntu系统下进行程序调试的时候出现以下错误信息:

[ %] 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[]: *** [test_coco] Error
make[]: *** [src/CMakeFiles/test_coco.dir/all] Error
make: *** [all] Error

  可以看出,之前的编译都没有问题,在最后的链接阶段出现错误,根据提示可知,libgsl库链接相关文件的时候出现问题。libgsl库依赖clbas库中的相关文件。所以在链接gls后还需加上对gslcblas的链接,问题解决!

上一篇:自定义sql server 聚合涵数


下一篇:Unity3D中的常用方法