ElectroJunkie
ElectroJunkie

Reputation: 301

gcc-c++-4.1.2 (dual) installation on Fedora 21

I would like to install GCC-C++-4.1.2 on my Fedora 21.

I was able to download gcc-4.1.2-33.i386.rpm but I am having difficulty installing it due to dependency problems in multiple steps. When I tried to resolve dependency, I ended up messing up the system, because I installed Fedora 64, while gcc-4.1.2 is 32 bit.

Also, I tried to compile from the source but the build doesn't complete with following errors.

In file included from ../../gcc-4.1.2/gcc/unwind-dw2.c:256:
../../gcc-4.1.2/gcc/config/i386/linux-unwind.h: In function ‘x86_fallback_frame_state’:
../../gcc-4.1.2/gcc/config/i386/linux-unwind.h:141: error: field ‘info’ has incomplete type
libgcc.mk:1135: recipe for target 'libgcc/32/unwind-dw2.o' failed
make[3]: *** [libgcc/32/unwind-dw2.o] Error 1
make[3]: Leaving directory '/home/Yui/Downloads/gcc412build/gcc'
Makefile:1436: recipe for target 'stmp-multilib' failed
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory '/home/Yui/Downloads/gcc412build/gcc'
Makefile:4166: recipe for target 'all-gcc' failed
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory '/home/Yui/Downloads/gcc412build'
Makefile:617: recipe for target 'all' failed
make: *** [all] Error 2

Does anyone have experience installing GCC-C++-4.1.2? I do need C++, not just GCC.

Any help would be appreciated.

Upvotes: 2

Views: 3188

Answers (1)

Sokel
Sokel

Reputation: 209

Here's the problem.

[root@lizzy ~]# uname -a
Linux lizzy.bromosapien.net 3.17.4-301.fc21.x86_64 #1 SMP Thu Nov 27 19:09:10 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@lizzy ~]# rpm -qa | grep gcc
gcc-4.9.2-1.fc21.x86_64

See that? Look at that really closely. That's the latest version according to my Fedora 21 x86_64 system. You're trying to install a compiler that is seven years old. I will give you credit for trying to use an rpm, but then you're trying to compile instead which is a huge no-no in the Red Hat world.

The real question is "why" not "how".

Seriously, you cannot justify using that old of a version. There is absolutely no way. Also, you shouldn't be trying to install a 32 bit compiler on a 64 bit machine. Even if yum had it available, you would get library conflicts and it would never install. You can easily do the following and be done with it:

yum install gcc gcc-c++

And that's it. You're done. That's how you install gcc to an RPM based system via yum. If you want 32 bit things going on, away from 64 bit, then install a 32 bit Fedora VM somewhere. Or... you can stay on your 64 bit machine and use this.

export CFLAGS=-m32
# or...
gcc -m32

Have fun.

Upvotes: 1

Related Questions