我在Linux服务器上运行以下makefile时遇到了以下错误:
gcc -m64 -O3 /export/projects/EL/mlml21/gsl-1.16/.libs/libgsl.a /export/projects/EL/mlml21/gsl-1.16/cblas/.libs/libgslcblas.a -I/export/projects/EL/mlml21/gsl-1.16 -std=c99 -o em em.c data.c prob_functions.c -lgsl -lgslcblas -lm /usr/bin/ld: 找不到-lgsl collect2: ld 返回 1 退出状态 make: *** [em] 错误 1
以下是相关的makefile内容:
default: em em_mex clean: rm -f *.o em
CBLAS_LIB=/export/projects/EL/mlml21/gsl-1.16/cblas/.libs GSL_LIB=/export/projects/EL/mlml21/gsl-1.16/.libs GSL_INCLUDE=/export/projects/EL/mlml21/gsl-1.16 MATLAB=/usr/local/R2013a em_mex: em_mex.c em.c data.c data.h prob_functions.c prob_functions.h $(MATLAB)/bin/mex $(GSL_LIB)/libgsl.a $(CBLAS_LIB)/libgslcblas.a -I$(GSL_INCLUDE) -arch=linux em_mex.c em.c data.c prob_functions.c em: em.c data.c data.h prob_functions.c prob_functions.h gcc -m64 -O3 $(GSL_LIB)/libgsl.a $(CBLAS_LIB)/libgslcblas.a -I$(GSL_INCLUDE) -std=c99 -o em em.c data.c prob_functions.c -lgsl -lgslcblas -lm
请注意,此错误是由于找不到库-lgsl而导致的。
gcc -m64 -O3 /export/projects/EL/mlml21/gsl-1.16/.libs/libgsl.a /export/projects/EL/mlml21/gsl-1.16/cblas/.libs/libgslcblas.a -I/export/projects/EL/mlml21/gsl-1.16 -std=c99 -o em em.c data.c prob_functions.c -lgsl -lgslcblas -lm /usr/bin/ld: 找不到-lgsl collect2: ld 返回 1 退出状态 make: *** [em] 错误 1
以下是相关的makefile内容:
default: em em_mex clean: rm -f *.o em
CBLAS_LIB=/export/projects/EL/mlml21/gsl-1.16/cblas/.libs GSL_LIB=/export/projects/EL/mlml21/gsl-1.16/.libs GSL_INCLUDE=/export/projects/EL/mlml21/gsl-1.16 MATLAB=/usr/local/R2013a em_mex: em_mex.c em.c data.c data.h prob_functions.c prob_functions.h $(MATLAB)/bin/mex $(GSL_LIB)/libgsl.a $(CBLAS_LIB)/libgslcblas.a -I$(GSL_INCLUDE) -arch=linux em_mex.c em.c data.c prob_functions.c em: em.c data.c data.h prob_functions.c prob_functions.h gcc -m64 -O3 $(GSL_LIB)/libgsl.a $(CBLAS_LIB)/libgslcblas.a -I$(GSL_INCLUDE) -std=c99 -o em em.c data.c prob_functions.c -lgsl -lgslcblas -lm
请注意,此错误是由于找不到库-lgsl而导致的。