在我提出的任何类似问题上,我无法找到问题的工作答案,所以我再问一次。
我的电脑是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。
我刚刚构建了库并使用了相同的编译器,为什么它会忽略它,因为它是错误的架构?