Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/157.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 在Mac 10.6.3上使用gsl_C++_Macos_Precompiled Headers_Gsl - Fatal编程技术网

C++ 在Mac 10.6.3上使用gsl

C++ 在Mac 10.6.3上使用gsl,c++,macos,precompiled-headers,gsl,C++,Macos,Precompiled Headers,Gsl,我最近有一个使用GSL的项目。在我在Mac 10.6.3上安装GSL包之后。我不能编译我的代码 gsl库位于/usr/local/lib,头文件位于/usr/local/ 当我编译代码时,我得到以下错误。如果我没有在makefile中指定“-m32”,它仍然会给出相同的错误,只需将“i386”更改为“x86_64”。有人能帮我吗 谢谢大家! #include <gsl/gsl_vector.h> #include <gsl/gsl_multiroots.h> 构建代码:

我最近有一个使用GSL的项目。在我在Mac 10.6.3上安装GSL包之后。我不能编译我的代码

gsl库位于/usr/local/lib,头文件位于/usr/local/

当我编译代码时,我得到以下错误。如果我没有在makefile中指定“-m32”,它仍然会给出相同的错误,只需将“i386”更改为“x86_64”。有人能帮我吗

谢谢大家!

#include <gsl/gsl_vector.h>
#include <gsl/gsl_multiroots.h>
构建代码:

CC = g++
OPT = -pg -g -I../include -L../libs -I../../Matrix-1.0/include -I../../bessel-1.1/include  -L../../Matrix-1.0/libs -L../../bessel-1.1/libs -L/usr/local/lib
LIBS =  -lfmm -lssi -lsparse -lbessel -lg2c -lgfortran -lgsl
.SUFFIXES : .o .cpp 

test_guide: test_guide.o
  ${CC} -o $@ ${OPT} test_guide.o ${LIBS} 

我不确定,但我认为您也需要与GSL的BLAS库进行链接。您的x86_64未定义引用似乎暗示了同样的内容(blas.o是我接下来要讲的提示)。加上

-lgslcblas

添加到LIBS变量。

构建程序时使用的确切命令是什么?Hello@bavariage我附上了构建代码,希望您能够解决问题。提前谢谢我也有同样的问题。我应该在哪里添加-lgslcblas?。我通过在/usr/local/lib中定位库并手动将其添加到项目中,在
LIBS
变量之后的makefile中,或者在XCode中我不知道的某个地方,做了一些黑客工作。我对麦克不熟悉。
-lgslcblas