J'ai récemment un projet utilisant GSL. Après avoir installé le package GSL sur Mac 10.6.3. Je ne peux pas compiler mon code. La bibliothèque gsl lib se trouve dans/usr/local/lib et le fichier head situé dans/usr/local /.Utiliser gsl sur Mac 10.6.3
Lorsque je compile mon code, j'obtiens l'erreur suivante. Si je ne spécifie pas "-m32" dans le makefile, il donne toujours la même erreur, il suffit de remplacer "i386" par "x86_64". Quelqu'un peut-il m'aider?
Merci! Par ailleurs, dois-je inclure gsl comme ci-dessus? En fait, je suis assez nouveau à la programmation.
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
Le code de construction:
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}
Quelle est la commande exacte que vous utilisez pour créer votre programme? –
Bonjour @Bavarious J'ai attaché le code de construction et espère que vous pouvez comprendre le problème. Merci d'avance –