Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ElKaputto on June 19, 2013, 10:14:18 pm

Title: dynamic libs (driver) settings
Post by: ElKaputto on June 19, 2013, 10:14:18 pm
Hello everyone,

I'm new to this forum and I'mk coming up with a question. Also I hope I am writing in the correct category.
I am programming on OpenNi and when I compile my code, I don't get an Error.
But running the code brings up the message that the file named *.so is not found.
I guess it has something to do with dynamic linker options (a makefile does it with something like "-Wl, rpath./").
So the code cannot find the driver of the sensor.

My question is: Where and how to put the right linker options for it?

Thx in advance!

ElKaputto
Title: Re: dynamic libs (driver) settings
Post by: oBFusCATed on June 20, 2013, 12:10:45 am
Read about LD_LIBRARY_PATH... and try to run your executable from a terminal.
Title: Re: dynamic libs (driver) settings
Post by: ElKaputto on June 20, 2013, 09:03:50 am
Thx for the hint.

From a terminal I can run this program. (If I run the makefile before).
Is there really no way to run it with the green "compile&run"-button?
Title: Re: dynamic libs (driver) settings
Post by: oBFusCATed on June 20, 2013, 11:57:22 am
There is, but you should no what you're doing.

There are many options:
1. C::B's build systems automatically modifies the LD_LIBRARY_PATH for you and adds all library search paths to it
2. You can use the env variable plugin change the variable
3. You can use -rpath to make the executable know where to find the libs