0

I need gcc-3.4 for compilation f some software.
I installed on my Ubuntu-12.4 using following instruction :--
https://superuser.com/questions/351742/how-to-install-gcc-3-4-on-ubuntu-11-10

sudo dpkg -i *.deb

gcc-3.4 hello.c

I compiled simple hello program. Then in the rpi_exp.c where, #include<stdio.h> begins i get lots of error. It seems as if libc is not found.

Please suggest is it the right package to install for this ?

There are many libraries here which one to install :?:
http://packages.ubuntu.com/hardy-updates/gcc-3.4

https://ftp7.de.netbsd.org/pub/releases.ubuntu.com/ubuntu/pool/main/g/glibc/ http://packages.ubuntu.com/hardy-updates/i386/libc6-i686/download

Error :--

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:

rpi_exp.c :---

#include <stdio.h>
int main() 
{ 
   printf("Hello, world!\n"); 
   return 0; 
}

I tried installing gcc-3.4 referring :---- http://simplyrisc.blogspot.in/2009/11/install-gcc-34-on-ubuntu-910.html

Error Got :---

>> 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

--------------------------- [EDIT] :--------------------------

Please help me what is getting wrong.

I need it to compile QEmu.

I again re-installed from following link, no warning no error :------
https://launchpad.net/ubuntu/+archive/primary/+sourcepub/277794/+listing-archive-extra

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

Program crashes again :-----

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'

Please help me what is getting wrong.

Community
  • 1
  • 1
Katoch
  • 2,709
  • 9
  • 51
  • 84
  • You should provide the error and the `hello.c` code. – n1xx1 Feb 02 '13 at 12:23
  • Setting up your own version of gcc in addition to the system gcc is a big pain. I installed gcc in my home directory on my ubuntu laptop a few years back, and while I did get it to work after fiddling with CPATH, LIBRARTY_PATH, etc., it was not a pleasant experience, and became a maintenance nightmare. I do not recommend it, and would do it in a chroot if I were to do it again. But perhaps there is a simpler way of doing it that I am unaware of. – amaurea Feb 02 '13 at 14:07
  • i need gcc-3.4 to build QEmu.. but after tons of hardwork i am not able to this small thing .. :-( – Katoch Feb 02 '13 at 14:41
  • gcc 3.4 is a very old (and buggy) release of GCC (released in 2004). You could install Qemu from its binary Ubuntu package, and you should, if wanting to compile it, use a much newer GCC version (current one is 4.7). I am able to compile Qemu 1.3.1 with GCC 4.7.2 on Debian/Sid (which is quite similar to Ubuntu 12.04) – Basile Starynkevitch Feb 02 '13 at 16:23
  • @BasileStarynkevitch I am having gcc-4.7.2 on my Ubantu-12.04. I will try it out – Katoch Feb 02 '13 at 17:21
  • 1
    Anything that hasn't been updated for _that_ kind of length of time that it doesn't compile with current GCC is (i) badly broken, as it depends on compiler bugs; (ii) hopelessly out of date in whatever area it is supposed to live; (iii) would need an extensive security audit due to the above. It must be something _very_ important to warrant such work/risk, and then porting forward to current C/C++ is a minor issue in comparison (and you'd have to do most of the required job as part of said audit, so...). – vonbrand Feb 02 '13 at 17:27

1 Answers1

0

Your error means your files aren't matched in version.

you should install gcc-3.4 having all these following .deb files:

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

install them by the following command: dpkg -i *.deb

Good Luck ;)

saeed M
  • 21
  • 7