Jump to content

[Code::blocks] Specify dynamic lib search path in cb:project


Guppy
 Share

Recommended Posts

bascially if you try to run a c++ project binary currently it will fail with

 

"mygame: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory"

 

now you can get around that by specifying LD_PATH=. mygame, but that is quite frankly ugly and inconvenient

 

So please in Project -> Build options -> Linker settings -> Other linker options put

 

-Wl,-rpath=\\$$$ORIGIN

 

 

( personally I use "-Wl,-rpath=\\$$$ORIGIN/sharedlibs/" to avoid causing clutter in the root dir but that's just me wink.png )

 

 

edit: swapped "." for \\$$$ORIGIN because as codeape pointed out you don't have to stand in the same directory to execute the file.

Edited by Guppy

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...