2

By exactly following this post, I was able to install gcc 3.4 on a fresh install of Ubuntu 14.04. But, when I try to compile a program, it fails with the following error:

/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

I've looked at this answer and installed build-essential but that did not resolve the issue. I still get the same error.

Also, I installed the dependencies for g++-3.4 before installing it:

sudo apt-get build-dep g++-3.4

UPDATE:

Trying gcc-3.4 -B/usr/lib/x86_64-linux-gnu hello.c removes the first two errors.

/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

UPDATE 2:

I read this post and tried it out on my system like below but it did not help:

gcc-3.4 -B /usr/lib/x86_64-linux-gnu -L /usr/lib/gcc/x86_64-linux-gnu/3.4.6/ hello.c
Phani
  • 21

1 Answers1

0

Try the following steps:

  1. Run the following commands:

    LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH
    export LIBRARY_PATH
    

This will eliminate the need to explicitly define the path whenever the C program is compiled.

  1. Install the following packages:

    sudo apt-get install libc6-dev
    sudo apt-get install gcc-multilib
    
  2. Create a symbolic link:

    sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
    
galoget
  • 2,963