“undefined reference to 'cblas_ddot'” when using cblas library

China☆狼群 提交于 2019-12-04 09:33:58

You can't just include the header - that only tells the compiler that the functions exist somewhere. You need to tell the linker to link against the cblas library.

Assuming you have a libcblas.a file, you can tell GCC about it with -lcblas.

The web site for GNU Scientific Library tells you how to do this:

Old Panda

My problem was just solved. The reason is that I made a mistake when inputed the link path. Thanks for Jonathon Reinhart's answers, they are really helpful when learning how to code in linux.

The compile commands are:

gcc -c test.c
gcc -L/usr/lib64 test.o -lgsl -lgslcblas -lm

Where "/usr/lib64" is the correct link path.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!