gcc 生成 makefile 但无法用它进行构建
我正在使用 Eclipse 3.3.1.1 和 gcc 将一个大型 C++ 项目从 Windows 移植到 Solaris 9。它生成了一个 makefile,但无法读取它:
gcc -f /export/home/MyPath/Debug/makefile -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: /_support/develop_tools/Sol10_gcc/gcc-4.2.4/configure --prefix=/usr/local/gcc4.2.4 --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++
Thread model: posix
gcc version 4.2.4
/usr/local/gcc4.2.4/libexec/gcc/sparc-sun-solaris2.10/4.2.4/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crt1.o /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crti.o /usr/ccs/lib/values-Xa.o /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crtbegin.o -L/usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4 -L/usr/ccs/lib -L/usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/../../.. /export/home/MyPath/Debug/makefile -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crtend.o /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.393
ld: fatal: file /export/home/MyPath/Debug/makefile: unknown file type
ld: fatal: File processing errors. No output written to a.out
collect2: ld returned 1 exit status
任何人都可以看到我做错了什么吗?我认为版本可能不兼容,但我对此很陌生。我将其设置为使用 gcc 编译器而不是 Solaris,但这没有帮助。会是什么?
I am porting a big C++ project from Windows to Solaris 9, using Eclipse 3.3.1.1 and gcc. It makes a makefile, but then it can't read it:
gcc -f /export/home/MyPath/Debug/makefile -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: /_support/develop_tools/Sol10_gcc/gcc-4.2.4/configure --prefix=/usr/local/gcc4.2.4 --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++
Thread model: posix
gcc version 4.2.4
/usr/local/gcc4.2.4/libexec/gcc/sparc-sun-solaris2.10/4.2.4/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crt1.o /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crti.o /usr/ccs/lib/values-Xa.o /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crtbegin.o -L/usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4 -L/usr/ccs/lib -L/usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/../../.. /export/home/MyPath/Debug/makefile -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crtend.o /usr/local/gcc4.2.4/lib/gcc/sparc-sun-solaris2.10/4.2.4/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.393
ld: fatal: file /export/home/MyPath/Debug/makefile: unknown file type
ld: fatal: File processing errors. No output written to a.out
collect2: ld returned 1 exit status
Can anyone see what I am doing wrong? I think maybe the versions are incompatible, but I am new to this. I set it to use gcc compilers instead of Solaris, but it didn't help. What can it be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Makefile 本身不应使用 gcc 进行编译,而是包含如何调用 gcc 的指令。
The Makefile itself should not be compiled using gcc, rather, it contains instructions how to invoke gcc.
尝试“make -f /export/home/MyPath/Debug/makefile -v”
Try "make -f /export/home/MyPath/Debug/makefile -v"