Page 1 of 1

setting LD_LIBRARY_PATH to load my project's libs

Posted: Sun Feb 22, 2009 9:57 pm
by endim
I just discovered CodeLite and it appears great! :D But I am having trouble setting up to debug my code with it. I have tried the forum search but every term I can think of is rejected as being too common. So my apologies if this has already been discussed and answered.

This is a Linux project. My workspace consists of several shared objects and a test program, all as separate projects in the workspace. My Makefiles put the test program in a "bin" subdirectory and the shared objects in a "lib" subdirectory. How do I set the LD_LIBRARY_PATH environment variable when my program loads to the directory my shared objects are built to, so that the debugger can load and execute my program?

Re: setting LD_LIBRARY_PATH to load my project's libs

Posted: Sun Feb 22, 2009 10:15 pm
by eranif
Hi,

Have u tried setting it from settings -> environment variable?

Create new variable named LD_LIBRARY_PATH with value: /path/to/my/libs:$(LD_LIBRARY_PATH)

Eran

Re: setting LD_LIBRARY_PATH to load my project's libs

Posted: Tue Feb 24, 2009 9:28 am
by endim
Thanks for your prompt response eranif. :)

I actually found a way to do it in the Project Settings Debugger tab, where I set a command to be passed to the debugger at startup:

set env LD_LIBRARY_PATH = ........

The problem with this solution is that I cannot use CodeLite variables, like $(IntermediateDirectory), to set it to the path according to the Debug or Release build location. Whenever I switch between them I have to go back in there and change it.

The problem with setting it in the IDE settings is that I want to carry the setting with me to other environments. I want to be able to set it in the workspace/project settings. I don't want to tell people they need to configure their IDE settings a certain way to use my project/workspace files.

I submitted a feature request to add something to the Project Settings dialog for this, perhaps under the General tab just under the Command Arguments setting, since they are related parameters.

This is a really nice IDE. Thanks to you and others for contributing it to the community!

Re: setting LD_LIBRARY_PATH to load my project's libs

Posted: Tue Feb 24, 2009 3:36 pm
by eranif
endim wrote:I submitted a feature request to add something to the Project Settings dialog for this, perhaps under the General tab just under the Command Arguments setting, since they are related parameters.
I will have a look at it.
Another idea that once I thought about it, it to have a settings for each variable: 'Save in workspace' this way user is able to save some of the variables as part of the workspace settings

Eran