gcc 生成 makefile 但无法用它进行构建

发布于 2024-11-11 17:41:13 字数 1436 浏览 3 评论 0原文

我正在使用 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 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

李白 2024-11-18 17:41:13

Makefile 本身不应使用 gcc 进行编译,而是包含如何调用 gcc 的指令。

The Makefile itself should not be compiled using gcc, rather, it contains instructions how to invoke gcc.

羞稚 2024-11-18 17:41:13

尝试“make -f /export/home/MyPath/Debug/makefile -v”

Try "make -f /export/home/MyPath/Debug/makefile -v"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文