Author Topic: No -R flag, how to set runtime search path?  (Read 3729 times)

Offline Clash

  • Single posting newcomer
  • *
  • Posts: 4
No -R flag, how to set runtime search path?
« on: September 02, 2009, 11:22:18 pm »
Hello!
How do I set the search path for the shared libraries at runtime? I don't want it to look only at /usr/lib
I'm on ubuntu and I can't find the envVar plugin on code::blocks 8.02
Thanks in advance!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: No -R flag, how to set runtime search path?
« Reply #1 on: September 02, 2009, 11:41:14 pm »
Hello!
How do I set the search path for the shared libraries at runtime? I don't want it to look only at /usr/lib
I'm on ubuntu and I can't find the envVar plugin on code::blocks 8.02
Thanks in advance!

You can set any linker parameters in your projects build options (tab "Linker settings -> Other linker options:").
In your case you should try :
Code
-Wl,-rpath=<lib-path>

Offline Clash

  • Single posting newcomer
  • *
  • Posts: 4
Re: No -R flag, how to set runtime search path?
« Reply #2 on: September 03, 2009, 12:01:08 am »
Thanks for the swift reply! It worked! :D

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: No -R flag, how to set runtime search path?
« Reply #3 on: September 03, 2009, 02:10:41 am »
Also you can use the LD_LIBRARY_PATH env variable
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]