LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Loading specified shared libraries (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/loading-specified-shared-libraries-765665/)

zvivered 10-30-2009 05:23 PM

Loading specified shared libraries
 
Hello,

I have two toolchains in my filesystem:
1. gcc 4.1.2 that was installed under /usr with Centos installation.
2. gcc 4.3.2 that was built by crosstool-ng-1.4.2

Each toolchain has its own shared libraries.

I build a simple application with the second toolchain and want to run it.
How can I tell linux to load the shared libraries of the second toolchain only ?

I tried to chain LD_LIBRARY_PATH but the output of ldd is the libraries of the first toolchain.

Thanks.

business_kid 11-09-2009 03:40 AM

Try this:
Install one gcc in /usr/bin
Install the other gcc miles away (/opt, /usr/local, it doesn't really matter).
the libs will go in the local trees - /usr/local/lib, /opt/lib, and version specific directories. Then change the path of the compiling usr
$ export PATH=/opt/bin:$PATH

You can check what libs they find with ldd. For a while I had gcc-2.95 and gcc-3.3.1 this way in /usr/bin & /usr/local


All times are GMT -5. The time now is 07:07 PM.