Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 113893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:46:27+00:00 2026-05-11T02:46:27+00:00

So. I have a problem where I have two versions of GCC on a

  • 0

So. I have a problem where I have two versions of GCC on a machine.
3.4.6 and 4.1

This is due to some dependency issues with a new piece of software. (requires glibc 4.1)

When I go to link this new software with the 4.1 libraries it links fine. However, when it comes to executing the software it can’t find the library, because it is looking at 3.4.6 in my LD_LIBRARY_PATH. If I set LD_LIBRARY_PATH to the 4.1 lib it blows up the shell,among killing other things, because the 3.4.6 libraries are used for that.

Its a bit of a catch 22.

Is there any way that at link time I can give an absolute path to that shared library without using the LD_LIBRARY_PATH?

This way I can hopefully have both versions, but only use 4.1 for this specific application?

  • 1 1 Answer
  • 4 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:46:28+00:00Added an answer on May 11, 2026 at 2:46 am

    You mean an absolute path that’s used when the program is started and that’s favored when looking for libraries? rpath is exactly that. It will overwrite the default search path and stuff set in LD_LIBRARY_PATH. Just tell gcc to pass it through to the linker:

    g++ -Wl,-rpath,/usr/lib/my_4.1 -omy_binary *.cpp 

    You can make it show you the search processing (use help to make it give you more options):

    [js@HOST2 cpp]$ LD_DEBUG=libs ./a.out   5859:     find library=libc.so.6 [0]; searching   5859:      search path=/usr/lib/my_4.1/tls/i686/sse2:/usr/lib/my_4.1/tls/i686:                /usr/lib/my_4.1/tls/sse2:/usr/lib/my_4.1/tls:                /usr/lib/my_4.1/i686/sse2:/usr/lib/my_4.1/i686:                /usr/lib/my_4.1/sse2:/usr/lib/my_4.1  (RPATH from file ./a.out)   5859:       trying file=/usr/lib/my_4.1/tls/i686/sse2/libc.so.6   5859:       ....   5859:      search cache=/etc/ld.so.cache   5859:       trying file=/lib/libc.so.6  (note: found here!)   5859: 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have two problem in this Case : I want to pass a JSON
I have had this problem w/ two seperate WYSWYG editors in my rails application
I have a problem with IE causing two errors: 1. Object doesn't support this
My actual problem is that I have encountered two versions of .NET 4.5 full
I have two versions of GCC installed on my system 4.6.2 and 4.7.0. I
I have installed two different python versions (3.1 and 2,7) And this is now
I have this joomla site. I have two versions of it, both using the
I have a problem with JNLP. When a computer has two Java versions installed,
I have a problem with CR (version that ships with VS2008). Report has two
I have a problem with two Textviews on the same height in a RelativeLayout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.