This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

incorrect library path in 3.0.1?


Just a note on this.  I have experienced the same problem with GCC
3.0.

I believe it is from the GCC 3.0 compilation.  I set the install prefix
for /usr/local/lib, however this is not reflected in the compiled gcc
executable.  Is there a build problem here?  Setting the
LD_LIBRARY_PATH=/usr/local/lib solves the problem.

$ 1014 ~/build/vx5r -> gcc --version
3.0.1

$ 1006 ~ -> gcc -print-search-dirs
install: /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/
programs: =/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/3.0.1/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../../i686-pc-linux-gnu/bin/i686-pc-linux-gnu/3.0.1/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../../i686-pc-linux-gnu/bin/
libraries: =/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/:/usr/lib/gcc/i686-pc-linux-gnu/3.0.1/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/3.0.1/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../../i686-pc-linux-gnu/lib/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../i686-pc-linux-gnu/3.0.1/:/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../:/lib/i686-pc-linux-gnu/3.0.1/:/lib/:/usr/lib/i686-pc-linux-gnu/3.0.1/:/usr/lib/


----- SNIP ORIGINAL MESSAGE ------

Hi Ed

If you add '/usr/local/lib' to your LD_LIBRARY_PATH environment variable
that should allow the shared objects (libraries) to get picked up.

LD_LIBRARY_PATH is usually defined in your '.cshrc' script (or whatever you
use).

Another answer is to rename the GCC '.so' modules to '.so.save' and then the
loader will pick up the '.a' versions of the libraries and statically link
them with your program. Makes programs bigger but they have less libraries
to lose!

Andy



"Ed MacDonald" <e_macdon@hotmail.com> wrote in message
news:3ba1d185.0107181107.12c7bd1a@posting.google.com...
> hello,
>
> i have a red hat 7 / pc system. just today, i installed gcc 3.0.
> previously, i had used gcc 2.96... which i installed as part of the
> red hat distro. when i installed 3.0, i did nothing with 2.96. perhaps
> that is what is causing my problem...
>
> i had a small program that i used to play around with the standard
> library (i'm in the learning process)... and it compiled under the old
> version. now, it still compiles fine, but when i try to run it, i get
> this error:
> (vec is the name of the program that i compiled)...
>
> [emacdona@DELLPC 2dvec]$ vec
> vec: error while loading shared libraries: libstdc++.so.3: cannot load
> shared object file: No such file or directory
>
>
> this may also be helpful:
>
> [emacdona@DELLPC 2dvec]$ ldd vec
> libstdc++.so.3 => not found
> libm.so.6 => /lib/i686/libm.so.6 (0x40022000)
> libgcc_s.so.1 => not found


-- 
- Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]