Linux gcc-3.4编译错误

Linux gcc-3.4编译错误,linux,gcc,ubuntu-12.04,qemu,gcc3,Linux,Gcc,Ubuntu 12.04,Qemu,Gcc3,我需要gcc-3.4来编译一些软件。 我使用以下说明安装了我的Ubuntu-12.4:-- sudo dpkg-i*.deb 我编译了一个简单的hello程序。 然后在rpi_exp.c中,\include开始我得到很多错误。 似乎找不到libc 请建议是否为此安装正确的软件包? 这里有许多要安装的库:?: 错误:-- rpi_exp.c:--- ---------------------------[编辑]:-------------------------- 请帮我看看哪里出了问题

我需要
gcc-3.4
来编译一些软件。
我使用以下说明安装了我的
Ubuntu-12.4
:--

sudo dpkg-i*.deb

我编译了一个简单的hello程序。 然后在rpi_exp.c中,
\include
开始
我得到很多错误。
似乎找不到
libc

请建议是否为此
安装正确的软件包?

这里有许多要安装的库:?:

错误:--

rpi_exp.c:---

---------------------------[编辑]:--------------------------

请帮我看看哪里出了问题

我需要它来编译QEmu

我再次从以下链接重新安装,没有警告,没有错误:-----

程序再次崩溃:-----


请帮助我哪里出错。

您的错误意味着您的文件版本不匹配

您应该安装gcc-3.4,其中包含以下所有.deb文件:

cpp-3.4_3.4.6-6ubuntu5_i386.deb g++-3.4_3.4.6-6ubuntu5_i386.deb gcc-3.4_3.4.6-6ubuntu5_i386.deb gcc-3.4-base_3.4.6-6ubuntu5_i386.deb libstdc++6-dev_3.4.6-6ubuntu5_i386.deb

通过以下命令安装它们: dpkg-i*.deb


祝你好运;)

您应该提供错误和
hello.c
代码。除了系统gcc之外,设置自己的gcc版本是一个很大的难题。几年前,我在我的ubuntu笔记本电脑的主目录中安装了gcc,虽然我在摆弄了CPATH、libarty_PATH等之后确实让它工作了,但这并不是一次愉快的经历,而且成了维护的噩梦。我不推荐这样做,如果我再这样做的话,我会马上做的。但也许有一种更简单的方法我不知道。我需要gcc-3.4来构建QEmu。。但是,经过大量的努力,我无法完成这件小事-(gcc 3.4是gcc(于2004年发布)的一个非常旧的(而且有缺陷)版本。你可以从它的二进制Ubuntu包安装Qemu,如果你想编译它,应该使用更新的gcc版本(当前版本是4.7)。我可以在Debian/Sid上用gcc 4.7.2编译Qemu 1.3.1(与Ubuntu 12.04非常类似)任何在当前GCC中没有编译的时间段内没有更新的东西都是(i)严重损坏的,因为它依赖于编译器错误;(ii)在它应该存在的任何领域都毫无希望地过时;(iii)由于上述原因,需要进行广泛的安全审计。保证此类工作/风险必须是非常重要的,相比之下,移植到当前的C/C++是一个小问题(并且您必须完成所需的大部分工作,作为审计的一部分,所以…)。
gcc-3.4 hello.c
ignite@ignite:~/testing$ gcc-3.4 rpi_exp.c
In file included from /usr/include/stdio.h:28,
                 from rpi_exp.c:1:
/usr/include/features.h:324:26: bits/predefs.h: No such file or directory
/usr/include/features.h:357:25: sys/cdefs.h: No such file or directory
/usr/include/features.h:389:23: gnu/stubs.h: No such file or directory
In file included from /usr/include/stdio.h:34,
                 from rpi_exp.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stddef.h:213: error: syntax error before "typedef"
In file included from rpi_exp.c:1:
/usr/include/stdio.h:36:25: bits/types.h: No such file or directory
In file included from rpi_exp.c:1:
/usr/include/stdio.h:49: error: syntax error before "typedef"
/usr/include/stdio.h:54: error: syntax error before "__USING_NAMESPACE_STD"
/usr/include/stdio.h: In function `__USING_NAMESPACE_STD':
/usr/include/stdio.h:65: error: storage class specified for parameter `__FILE'
In file included from /usr/include/_G_config.h:20,
                 from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:75,
                 from rpi_exp.c:1:
#include <stdio.h>
int main() 
{ 
   printf("Hello, world!\n"); 
   return 0; 
}
>> ignite@ignite:~/testing$ sudo dpkg -i *.deb


Reading database ... 159968 files and directories currently installed.)
Preparing to replace cpp-3.4 3.4.6-6ubuntu3 (using cpp-3.4_3.4.6-8ubuntu2_i386.deb) ...
Unpacking replacement cpp-3.4 ...
Selecting previously unselected package g++-3.4.
Unpacking g++-3.4 (from g++-3.4_3.4.6-6ubuntu3_i386.deb) ...
Selecting previously unselected package gcc-3.4.
Unpacking gcc-3.4 (from gcc-3.4_3.4.6-8ubuntu2_i386.deb) ...
Preparing to replace gcc-3.4-base 3.4.6-6ubuntu3 (using gcc-3.4-base_3.4.6-8ubuntu2_i386.deb) ...
Unpacking replacement gcc-3.4-base ...
Selecting previously unselected package libstdc++6-dev.
Unpacking libstdc++6-dev (from libstdc++6-dev_3.4.6-6ubuntu3_i386.deb) ...
dpkg: dependency problems prevent configuration of g++-3.4:
 g++-3.4 depends on gcc-3.4 (= 3.4.6-6ubuntu3); however:
  Version of gcc-3.4 on system is 3.4.6-8ubuntu2.
 g++-3.4 depends on gcc-3.4-base (= 3.4.6-6ubuntu3); however:
  Version of gcc-3.4-base on system is 3.4.6-8ubuntu2.

dpkg: error processing g++-3.4 (--install):
 dependency problems - leaving unconfigured
Setting up gcc-3.4-base (3.4.6-8ubuntu2) ...
dpkg: dependency problems prevent configuration of libstdc++6-dev:
 libstdc++6-dev depends on g++-3.4 (= 3.4.6-6ubuntu3); however:
  Package g++-3.4 is not configured yet.
 libstdc++6-dev depends on gcc-3.4-base (= 3.4.6-6ubuntu3); however:
  Version of gcc-3.4-base on system is 3.4.6-8ubuntu2.

dpkg: error processing libstdc++6-dev (--install):
 dependency problems - leaving unconfigured
Setting up cpp-3.4 (3.4.6-8ubuntu2) ...
Processing triggers for man-db ...
Setting up gcc-3.4 (3.4.6-8ubuntu2) ...
Errors were encountered while processing:
 g++-3.4
 libstdc++6-dev
cpp-3.4_3.4.6-6ubuntu3_i386.deb
g++-3.4_3.4.6-6ubuntu3_i386.deb
gcc-3.4_3.4.6-6ubuntu3_i386.deb
gcc-3.4-base_3.4.6-6ubuntu3_i386.deb
libstdc++6-dev_3.4.6-6ubuntu3_i386.deb
ignite@ignite:~/testing$ gcc-3.4 rpi_exp.c
In file included from /usr/include/stdio.h:28,
                 from rpi_exp.c:1:
/usr/include/features.h:324:26: bits/predefs.h: No such file or directory
/usr/include/features.h:357:25: sys/cdefs.h: No such file or directory
/usr/include/features.h:389:23: gnu/stubs.h: No such file or directory
In file included from /usr/include/stdio.h:34,
                 from rpi_exp.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stddef.h:213: error: syntax error before "typedef"
In file included from rpi_exp.c:1:
/usr/include/stdio.h:36:25: bits/types.h: No such file or directory
In file included from rpi_exp.c:1:
/usr/include/stdio.h:49: error: syntax error before "typedef"
/usr/include/stdio.h:54: error: syntax error before "__USING_NAMESPACE_STD"
/usr/include/stdio.h: In function `__USING_NAMESPACE_STD':
/usr/include/stdio.h:65: error: storage class specified for parameter `__FILE'
In file included from /usr/include/_G_config.h:20,
                 from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:75,
                 from rpi_exp.c:1:
/usr/include/wchar.h:95: error: storage class specified for parameter `__mbstate_t'
In file included from /usr/include/libio.h:32,
                 from /usr/include/stdio.h:75,
                 from rpi_exp.c:1:
/usr/include/_G_config.h:24: error: syntax error before "__off_t"
/usr/include/_G_config.h:29: error: syntax error before "__off64_t"
/usr/include/_G_config.h:53: error: storage class specified for parameter `_G_int16_t'
/usr/include/_G_config.h:54: error: storage class specified for parameter `_G_int32_t'
/usr/include/_G_config.h:55: error: storage class specified for parameter `_G_uint16_t'
/usr/include/_G_config.h:56: error: storage class specified for parameter `_G_uint32_t'
In file included from /usr/include/libio.h:53,
                 from /usr/include/stdio.h:75,
                 from rpi_exp.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stdarg.h:43: error: storage class specified for parameter `__gnuc_va_list'
In file included from /usr/include/stdio.h:75,
                 from rpi_exp.c:1:
/usr/include/libio.h:182: error: storage class specified for parameter `_IO_lock_t'
/usr/include/libio.h:302: error: syntax error before "__off_t"
/usr/include/libio.h:312: error: syntax error before "_IO_lock_t"
/usr/include/libio.h:340: error: syntax error before '}' token
/usr/include/libio.h:343: error: storage class specified for parameter `_IO_FILE'
/usr/include/libio.h:348: error: storage class specified for parameter `_IO_2_1_stdin_'
/usr/include/libio.h:349: error: storage class specified for parameter `_IO_2_1_stdout_'
/usr/include/libio.h:350: error: storage class specified for parameter `_IO_2_1_stderr_'
/usr/include/libio.h:366: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:366: error: syntax error before "__io_read_fn"
/usr/include/libio.h:374: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:374: error: redefinition of parameter '__ssize_t'
/usr/include/libio.h:366: error: previous definition of '__ssize_t' was here
/usr/include/libio.h:374: error: syntax error before "__io_write_fn"
/usr/include/libio.h:383: error: syntax error before "__off64_t"
/usr/include/libio.h:383: error: storage class specified for parameter `__io_seek_fn'
/usr/include/libio.h:386: error: storage class specified for parameter `__io_close_fn'
/usr/include/libio.h:418: error: syntax error before '*' token
/usr/include/libio.h:418: error: storage class specified for parameter `__underflow'