최근에 GSL을 사용하는 프로젝트가 있습니다. Mac 10.6.3에 GSL 패키지를 설치 한 후. 내 코드를 컴파일 할 수 없습니다.Mac에서 gsl 사용 10.6.3
gsl lib는/usr/local/lib에 있고 헤드 파일은/usr/local /에 있습니다.
코드를 컴파일 할 때 다음 오류가 발생합니다. 메이크 파일에 "-m32"를 지정하지 않으면 여전히 동일한 오류가 발생하며 "i386"을 "x86_64"로 변경하십시오. 누구든지 나를 도울 수 있습니까?
감사합니다.
#include <gsl/gsl_vector.h>
#include <gsl/gsl_multiroots.h>
그런데 내가 위의 gsl을 포함해야합니까? 사실 저는 프로그래밍을 처음 접했습니다.
Undefined symbols for architecture i386:
"_gsl_vector_get", referenced from:
gsl_root_finding::print_state(unsigned long, gsl_multiroot_fdfsolver*)in test_guide.o
gsl_root_finding::print_state(unsigned long, gsl_multiroot_fsolver*)in test_guide.o
gsl_root_finding::mm_f(gsl_vector const*, void*, gsl_vector*)in test_guide.o
gsl_root_finding::process(int, double*, double, double)in test_guide.o
gsl_root_finding::mm_fdf(gsl_vector const*, void*, gsl_vector*, gsl_matrix*)in test_guide.o
gsl_root_finding::mm_df(gsl_vector const*, void*, gsl_matrix*)in test_guide.o
"_gsl_vector_set", referenced from:
gsl_root_finding::mm_f(gsl_vector const*, void*, gsl_vector*)in test_guide.o
gsl_root_finding::process(int, double*, double, double)in test_guide.o
gsl_root_finding::mm_fdf(gsl_vector const*, void*, gsl_vector*, gsl_matrix*)in test_guide.o
gsl_root_finding::mm_df(gsl_vector const*, void*, gsl_matrix*)in test_guide.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make: *** [test_guide] Error 1
빌드 코드 :
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 [email protected] ${OPT} test_guide.o ${LIBS}
프로그램을 작성하는 데 사용하는 정확한 명령은 무엇입니까? –
안녕하세요 @Bavarious 저는 빌드 코드를 첨부하여 문제를 파악할 수 있기를 바랍니다. 사전에 감사합니다 –