LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1415|回复: 14

怎么在gcc4下编译gcc3?

[复制链接]
发表于 2007-10-30 19:21:01 | 显示全部楼层 |阅读模式
我现在的系统里面的gcc版本是4.1.2,我想用gcc3.1.1,于是下了一个源码包,但是编译通不过。。。那位知道怎么弄?

错误提示:
./read-rtl.c: 在函数 ‘read_rtx’ 中:
./read-rtl.c:662: 错误:自增运算中的左值无效
发表于 2007-10-30 19:39:06 | 显示全部楼层
兩者相隔這麼多的版本,也許未必能一步登天

gcc-4.1.2 -> 3.1.1 我未試過,但 gcc-4.1.2 -> gcc-3.3.6 以及 gcc-3.3.6 -> gcc-3.1.1 就肯定沒問題,如果真的不行就分再次進行好了

話說回來,用 gcc-3.3.6 行不,非要 gcc-3.1.1?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-10-30 20:36:56 | 显示全部楼层
是这样的,ns2.26版本加上p2p的patch,官网上只有一个用3.1.1编译通过的示例。我用4.1.2编译很多问题。这也是没办法的办法了。。。
回复 支持 反对

使用道具 举报

发表于 2007-10-30 21:24:39 | 显示全部楼层
gcc-3.3.6 跟 gcc-3.1.1 同屬第一版的 ABI,除非你的軟件語法不嚴謹,否則應該能用 gcc-3.3.6 進行編譯,何不先用 gcc-3.3.6 試之,通不過再用 gcc-3.3.6 來編譯 gcc-3.1.1 好了
回复 支持 反对

使用道具 举报

发表于 2007-10-30 21:31:31 | 显示全部楼层
为什么要打那么多繁体字。
回复 支持 反对

使用道具 举报

发表于 2007-10-30 21:37:14 | 显示全部楼层
我現在用的系統是繁體中文的。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-10-31 21:50:06 | 显示全部楼层
我用gcc4.1.2编译3.3.4成功了并装到了/usr/local下面,但是用3.3.4还是编译不了3.1.1真是郁闷阿。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-10-31 21:51:21 | 显示全部楼层
错误如下:看样子是3.1.1和后面的差别很大。。。

gcc-3.1.1/i686-pc-linux-gnu/libstdc++-v3/include -I../libsupc++ -I../libmath
-g -O2 -D_GNU_SOURCE -fno-implicit-templates -Wall -Wno-format -W -Wwrite-str
ings -Winline -fdiagnostics-show-location=once -ffunction-sections -fdata-sec
tions -g -c c++locale.cc  -fPIC -DPIC -o .libs/c++locale.o
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long int]':
c++locale.cc:51: `__strtol_l' undeclared (first use this function)
c++locale.cc:51: (Each undeclared identifier is reported only once for each
   function it appears in.)
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long unsigne
d
   int]':
c++locale.cc:69: `__strtoul_l' undeclared (first use this function)
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long long
   int]':
c++locale.cc:87: `__strtoll_l' undeclared (first use this function)
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long long
   unsigned int]':
c++locale.cc:106: `__strtoull_l' undeclared (first use this function)
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = float]':
c++locale.cc:124: `__strtof_l' undeclared (first use this function)
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = double]':
c++locale.cc:141: `__strtod_l' undeclared (first use this function)
c++locale.cc: In function `void std::__convert_to_v(const char*, _Tv&,
   std::_Ios_Iostate&, __locale_struct* const&, int) [with _Tv = long double]
':
c++locale.cc:158: `__strtold_l' undeclared (first use this function)
c++locale.cc: In static member function `static void
   std::locale::facet::_S_create_c_locale(__locale_struct*&, const char*,
   __locale_struct*)':
c++locale.cc:170: `__newlocale' undeclared (first use this function)
c++locale.cc: In static member function `static void
   std::locale::facet::_S_destroy_c_locale(__locale_struct*&)':
c++locale.cc:180: `__freelocale' undeclared (first use this function)
c++locale.cc: In static member function `static __locale_struct*
   std::locale::facet::_S_clone_c_locale(__locale_struct*&)':
c++locale.cc:184: `__duplocale' undeclared (first use this function)
make[3]: *** [c++locale.lo] 错误 1
make[3]: Leaving directory `/mnt/j/linux_fs/download_dp/gcc-3.1.1/i686-pc-lin                 ux-gnu/libstdc++-v3/src'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/mnt/j/linux_fs/download_dp/gcc-3.1.1/i686-pc-lin                 ux-gnu/libstdc++-v3'
make[1]: *** [all-recursive-am] 错误 2
make[1]: Leaving directory `/mnt/j/linux_fs/download_dp/gcc-3.1.1/i686-pc-lin                 ux-gnu/libstdc++-v3'
make: *** [all-target-libstdc++-v3] 错误 2
回复 支持 反对

使用道具 举报

发表于 2007-10-31 22:16:15 | 显示全部楼层
幾個問題:

1. gcc-3.3.4 是怎樣 configure 的?
2. 如何確認編譯 gcc-3.1.1 的時候是使用 gcc-3.3.4 的?
3. gcc-3.1.1 是怎樣 configure 的?
4. 你的 ns2.26 軟件能否用 gcc-3.3.4 來進行編譯?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-10-31 22:59:29 | 显示全部楼层
configure本身只是shell命令。在配置cc的时候是这样的cc = gcc,按照我的$PATH,/usr/local/bin在/usr/bin之前,所以我把gcc3.3.4装到/usr/local里面后在/usr/local/bin里面的就是3.3.4的版本,按照这个路径搜索,找到的gcc就应该是3.3.4相应的include也是3.3.4的库文件。ns2.26用3.3.4编译通过了,但是加上gnutella和pdns补丁之后编译出来的pdns不能正常工作,估计还是与gcc版本有关。我用3.3.4编译3.1.1的时候问题都在上面,说明编译3.1.1需要的函数在3.3.4里面可能没有。

不过编译出的pdns不能正常使用确实很让我头痛,好不容易才编译通过了。。。还改了不少语法不严格的地方。。。体力活阿。。。偶再弄弄。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表