2

对于我提出的任何类似问题,我都找不到有效的答案,所以我再次询问。

我的电脑是 Mac OSX 10.8 Mountain Lion。我正在尝试使用 gfortran 构建一个 Fortran 程序,但我遇到了这样的错误:

gfortran-mp-4.7 -O2 -c constants.f90
gfortran-mp-4.7 -O2 -c utils.F90
...(more source files)
ar -r libcamb.a constants.o utils.o ...(more source files)
/opt/local/bin/ranlib: file: libcamb.a(constants.o) has no symbols
gfortran-mp-4.7 -DMATRIX_SINGLE -O2 -I../camb -I../multinest -DDR71RG -DNOWMAP -c utils.F90
gfortran-mp-4.7 -DMATRIX_SINGLE -O2 -I../camb -I../multinest -DDR71RG -DNOWMAP -c ParamNames.f90
gfortran-mp-4.7 -DMATRIX_SINGLE -O2 -I../camb -I../multinest -DDR71RG -DNOWMAP -c Matrix_utils.F90
gfortran-mp-4.7 -DMATRIX_SINGLE -O2 -I../camb -I../multinest -DDR71RG -DNOWMAP -c settings.f90
gfortran-mp-4.7 -DMATRIX_SINGLE -O2 -I../camb -I../multinest -DDR71RG -DNOWMAP -c GetDist.f90
gfortran-mp-4.7 -o ../getdist utils.o ParamNames.o Matrix_utils.o settings.o GetDist.o -L../camb -lcamb -llapack -latlas -Wl,-framework -Wl,accelerate -L/opt/local/lib -lgsl -lgslcblas -DMATRIX_SINGLE -O2 -I../camb -I ../multinest -DDR71RG -DNOWMAP 
ld: warning: ignoring file ../camb/libcamb.a, file was built for archive which is not the architecture being linked (x86_64): ../camb/libcamb.a
Undefined symbols for architecture x86_64:
<<long list of undefined functions that are defined in the library that was ignored>>
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

arch返回 i386 并uname -a在最后显示 x86_64。

我刚刚构建了库并使用了相同的编译器,为什么它说它忽略了它,因为它是错误的架构?

4

0 回答 0