免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4519 | 回复: 11
打印 上一主题 下一主题

solaris10 安装gcc编译器成功,但编译时出现问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-15 14:27 |只看该作者 |倒序浏览
我在http://www.sunfreeware.com/indexsparc10.html下载了gcc-3.4.6-sol10-sparc-local.gz,并用pkgadd安装成功。

这是安装后的gcc -v信息:
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6

但我使用gcc来编译cpp文件时,出现了大量错误,如下(节选,完整错误log请看附件)

In file included from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/sparc-sun-solaris2.10/bits/c++locale.h:41,
                 from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/iosfwd:46,
                 from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/ios:44,
                 from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/ostream:45,
                 from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/iostream:45,
                 from tst.cpp:1:
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/clocale:49:20: locale.h: No such file or directory

/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:79: error: `::memcpy' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:80: error: `::memmove' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:81: error: `::strcpy' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:82: error: `::strncpy' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:83: error: `::strcat' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:84: error: `::strncat' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:85: error: `::memcmp' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:86: error: `::strcmp' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:87: error: `::strcoll' has not been declared
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/cstring:88: error: `::strncmp' has not been declared

err.tar (120 KB, 下载次数: 24)

注意该log中,tst.cpp是我编译的文件名,其line 1是:#include <iostream>

我用的命令是 gcc -o test tst.cpp

论坛徽章:
0
2 [报告]
发表于 2008-07-15 14:50 |只看该作者
补充一点,我还安装了libiconv-1.11-sol10-sparc-local.gz和libintl-3.4.0-sol10-sparc-local.gz,gcc依赖于这两个库。

论坛徽章:
0
3 [报告]
发表于 2008-07-15 14:54 |只看该作者
在Linux上gcc用来c++程序需要n多命令行选项。所以用g++,他默认带了这些选项。solaris10是不是也这样?

论坛徽章:
0
4 [报告]
发表于 2008-07-15 16:05 |只看该作者
楼上,用g++的结果是一样的

论坛徽章:
0
5 [报告]
发表于 2008-07-17 14:19 |只看该作者
顶一下,求答案ing……

论坛徽章:
0
6 [报告]
发表于 2008-07-22 13:05 |只看该作者
继续顶,难道大家都没遇到个这个问题么……

论坛徽章:
0
7 [报告]
发表于 2008-07-22 13:29 |只看该作者
是否用简单的hello world程序测试过?如果有问题,应该检查一下/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../../../include/c++/3.4.6/下文件的完整性,C++不熟,把帖子发到C++版块可能比较好

论坛徽章:
0
8 [报告]
发表于 2008-07-22 13:41 |只看该作者
soalris 10 x86 默认安装了 gcc   ,
路径为

/usr/sfw/bin/gcc ,你可以尝试这个.

论坛徽章:
0
9 [报告]
发表于 2008-07-22 14:00 |只看该作者
楼主的应该是sparc,不是x86
我也刚装的一个10,环境和楼主一样的,
如果你的tst.cpp没有什么秘密,不妨传上来,我可以在我的系统上编译试试。
不过,我可是个c++盲哦……

论坛徽章:
0
10 [报告]
发表于 2008-07-22 14:20 |只看该作者
i don't know,study
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP