I'm in a desperate need of help with gcc 4.2.2 installation on Linux OpenSUSE 10.2.
I'm a mechanical engineering student and i need it installed on my home PC for my diploma thesis - it's quite urgent, i've been battling with it for a month. I need gcc 4.2.2. compiled and running as soon as possible, so any help is deeply appreciated.

thank You in advance,


Tomislav

Dani AI

Generated

Short expert note (keeps what and earlier replies already said, with practical next steps and gotchas).

The fastest, lowest-risk route is to install a prebuilt compiler from openSUSE’s package system (YaST / Software Management — choose the “Development” pattern or install gcc, gcc-c++, make and binutils). That avoids the long bootstrap/build process and the common “no compiler to build a compiler” problem mentioned above. Use YaST’s GUI or the CLI (yast --install gcc gcc-c++ make binutils; newer systems also accept zypper install ...). (documentation.suse.com)

If GCC 4.2.2 is strictly required and no matching RPM exists for 10.2, two realistic options remain: find a matching RPM built for 10.2, or build from source. The official GCC 4.2.2 source tarballs are available from the GNU releases archive (GCC 4.2.2 sources). Building from source requires an existing system compiler to bootstrap, and the GMP/MPFR libraries (and on some toolchains MPC); either install those devel packages from repos or build/install GMP then MPFR before configuring GCC. Typical sequence (high level):

# get sources
wget https://gcc.gnu.org/pub/gcc/releases/gcc-4.2.2/gcc-4.2.2.tar.bz2
tar -xjf gcc-4.2.2.tar.bz2
# build/install GMP and MPFR (or use distro -devel packages)
# configure in an out-of-tree build dir
mkdir obj && cd obj
../gcc-4.2.2/configure --prefix=/opt/gcc-4.2.2 --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local --with-mpfr=/usr/local
make bootstrap
sudo make install

See the GMP/MPFR project pages for matching version guidance and the GNU archive for the tarball. (gcc.gnu.org)

“Binutils” are the assembler/linker and related tools (as, ld, ar, nm, etc.) that GCC calls during compilation; a mismatched binutils can cause build/link problems, so install a compatible binutils package or match the version used to build GCC. Also note GCC 4.2.x bootstraps by default (it expects a working toolchain unless you disable bootstrap). (en.wikipedia.org)

Because openSUSE 10.2 is long EOL (maintenance ended in 2008), building/upgrading on that host can be painful; using a VM, chroot or a small modern live image (or a container) with the needed toolchain is often the fastest, most reproducible path for an urgent thesis workload. (en.opensuse.org)

Summary: follow ’s YaST route if a package is acceptable; if 4.2.2 is mandatory, grab the GNU 4.2.2 sources and GMP/MPFR, build in a clean out-of-tree directory and run make bootstrap; expect a multi-hour compile and some troubleshooting on an EOL host. (documentation.suse.com)

Recommended Answers

All 7 Replies

So what's the problem?

i don't knnow how to install it, that is the problem. :) do i need to compile the bin utilities (what are they anyway? - i'm a total beginner) is there a good page where i can find a step - by- step installation guide? i browsed the official GNU page but i still don't know what to do.

If you don't already have a compiler on your system, it's going to be pretty useless trying to compile the source code of the compiler that you don't have. Sort of a chicken-egg situation going on here. What you need to do is run the package manager, YaST, and install gcc and any related tools that you might need.

I assumed he already had an older version of gcc installed as he was quite specific with the version number ;-)

I assumed he already had an older version of gcc installed as he was quite specific with the version number ;-)

Well, your post was correct -- the OP did ask how to compile gcc in the first place. But, describing himself as a 'total newbie', I assumed that he didn't have any version of gcc installed at all. (Plus, anyone who installed an older version of gcc with YaST could probably figure out how to install a newer version :-)

What you need to do is run the package manager, YaST, and install gcc and any related tools that you might need.

first of all: THANK YOU! this even sounds like it could work. :) i'll browse the Net for instructions and pray alot. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.