Results 1 to 8 of 8

Thread: Difficulties installing GCC 3.1

Hybrid View

  1. #1

    Difficulties installing GCC 3.1

    Hi all,

    I'm trying to figure out how to install GCC 3.1 from source. I've tried several times to no avail. I'm a newbie to Linux, but I want to learn how to install apps from source. (I have read that the compiler would be the hardest thing for a newbie to install, so I wanted to figure out how.) I downloaded the full source tarball of GCC 3.1. I've read the documentation that comes with that several times (it's confusing, but I did it). So, I tried doing this:

    $ mkdir gcc-build-3.1
    $ cd gcc-build-3.1
    $ ../gcc-3.1/configure --prefix=/home/x/Programs/gcc-3.1
    $ make bootstrap
    $ make prefix=/home/x/Programs/gcc-3.1 install

    Now, to test out the compiler I have it compile a simple c++ program I wrote to output 'Hello.'. I type the following to compile and run the program:

    $ /home/x/Programs/gcc-3.1/bin/g++ -o hello hello.cpp
    $ ./hello

    When I do that, I get the following:

    error while loading shared libraries: libstdc++.so.4: cannot open shared object file: No such file or directory

    Isn't that my standard c++ library? Why wasn't that installed? And how do I install it?

    (BTW, I'm running Mandrake Linux 8.1 Standard Edition with GCC 2.96)

  2. #2

    Re: Difficulties installing GCC 3.1

    IIRC, on a regular installation of Mandrake none of these libraries are installed unless you chose them. *Open the rpm management program thingy and check to see what you can or what you have installed. *Then, if you have a cd, just install the libraries.

  3. #3

    Re: Difficulties installing GCC 3.1

    When I looked through the Mandrake Update in Software Manager, I discovered they had GCC3.0.1-1.1 in RPM format (with it's libraries... it installed libstdc++.so.3).

    GCC 3.0.1-1.1 and GCC 3.0.4 (installed that this morning from source) both compile the app... and the app runs properly and outputs 'Hello.'. However, GCC 3.1 still complains of missing libraries.

    I guess what I'm trying to ask is: what wasn't installed, why wasn't it installed, and how do I install it? I'm trying to do as much of this by source as possible because I want to learn what's going on... so if anyone could help or point me in the direction of help that a newbie can understand, I'd much appreciate it!

  4. #4

    Re: Difficulties installing GCC 3.1

    Try making a link from libstdc++.so.3 to libstdc++.so.4

  5. #5

    Oops! Sorry! libstdc++.so.4 does exist!

    When I went to make a link, I suddenly realized that I hadn't checked to see if libstdc++.so.4 existed... (embarresed pause)... and it did. The strange thing was, it's path was '/home/x/Programs/gcc-3.1/lib/libstdc++.so.4'. It was a link to 'libstdc++.so.4.0.0', so I made a link to that in '/usr/lib' to it, and now I can compile my c++ apps just fine (with just that user, obviously)...

    So... why were my GCC libraries put under '/home/x/Programs/gcc-3.1/lib'? And why didn't GCC know that's where they were since GCC installed them there itself?

    Is there any way to compile GCC in such a way that it DOES know where those libraries are?

  6. #6

    Re: Difficulties installing GCC 3.1


    * * *$ ../gcc-3.1/configure --prefix=/home/x/Programs/gcc-3.1
    * * *$ make bootstrap
    * * *$ make prefix=/home/x/Programs/gcc-3.1 install
    Because of this
    You make the prefix = /home/x/Programs/gcc-3.1 not /usr
    so you have to edit /etc/ld.so.config and add the lib path and then run ldconfig.

  7. #7

    It worked!

    Thanks! GCC 3.1 works now!

    As I said, I'm a newbie...

  8. #8

    Re: Difficulties installing GCC 3.1

    No problem ;D

Similar Threads

  1. Difficulties with iptables and multihoming
    By kristrev in forum Security
    Replies: 1
    Last Post: 03-18-2009, 03:42 PM
  2. Networking Difficulties
    By Zbeggy in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 04-02-2005, 11:54 PM
  3. Distro Difficulties!
    By jman_77 in forum Linux - General Topics
    Replies: 9
    Last Post: 06-13-2002, 05:17 PM
  4. Installing
    By mugs in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 06-02-2002, 07:55 PM
  5. Installing GTK with apt-get
    By gmoreno in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 03-05-2002, 03:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •