error: cannot specify -o when generating multiple output fies

发布于 2022-09-05 04:11:43 字数 2567 浏览 32 评论 0

Mac目前装了xcode,系统是os sierra,gcc版本(如下):
yomatoMacBook-Pro:treecluster yanan_77$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


需要编译的makefile文件如下:
1 CC = icc
2 CPP = gcc
3 #CPP = g++
4 FF = g77
5 CFLAGS = -O3 -Wall
6 # CFLAGS = -O2
7 FFLAGS = -O2
8 OBJDIR = .
9 # INCDIR = -Iincludes -I/opt/sac/include -I /usr/include
10 #
11 INCDIR = -Iincludes -I/usr/local/fftw--with-gcc/include
12 # LIBDIR = -Lsac_lib -lsac -lm -lsacio
13 # -lfftw3
14 LIBDIR = -lm /usr/local/fftw--with-gcc/lib -lfftw3
15
16 all: corrcoefsac extrasacdata pickpossac sacinterfcosnew stacksac_flst1
17 corrcoefsac: corrcoefsac.cpp includes/sac_o.h
18 ${CPP} ${CFLAGS} -o ${OBJDIR}/$@ $^ ${INCDIR} ${LIBDIR}
19 extrasacdata: extrasacdata.cpp includes/sac_o.h
20 ${CPP} ${CFLAGS} -o ${OBJDIR}/$@ $^ ${INCDIR} ${LIBDIR}
21 pickpossac: pickpossac.cpp includes/sac_o.h
22 ${CPP} ${CFLAGS} -o ${OBJDIR}/$@ $^ ${INCDIR} ${LIBDIR}
23 sacinterfcosnew: sacinterfcosnew.cpp sub/mysubs.cpp sub/mysacio.cpp


执行命令:make
出现如下错误:
clang: error: cannot specify -o when generating multiple output files
make: * [corrcoefsac] Error 1


电脑还装了gfortran ,看了一下版本:
yomatoMacBook-Pro:velchange yanan_77$ gfortran -v
使用内建 specs。
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/x86_64-apple-darwin16/6.3.0/lto-wrapper
目标:x86_64-apple-darwin16
配置为:../gcc-6.3.0/configure --prefix=/usr/local/gfortran --enable-languages=c,c++,fortran,objc,obj-c++ --build=x86_64-apple-darwin16 --with-gmp=/Users/fx/devel/gcc/deps-static/x86_64 --with-mpfr=/Users/fx/devel/gcc/deps-static/x86_64 --with-mpc=/Users/fx/devel/gcc/deps-static/x86_64 --with-isl=/Users/fx/devel/gcc/deps-static/x86_64
线程模型:posix
gcc 版本 6.3.0 (GCC)

不太明白安装gfortran的同时也装了一个gcc,还是一个高版本,是不是和我的问题有关??


作为一名菜鸟,我也是搜索了很多解决方法(基本都是国外的),但是都不是很对路(也可能英文太差理解不了),大概可能是xcode的gcc的问题?具体怎么解决方法没有找到,求教各位大神,专门为了这个问题注册了本网站,希望可以找到解决办法,thank you in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文