Page 1 of 1

Specify DLL Library path

Posted: Mon Sep 27, 2010 4:47 am
by TurboLento
Hi all. I've started using CodeLite recently, coming from CodeBlocks, and I'm enjoying it, specially the refactoring tools! Here's a question that I've not found answered in the forum, and needed help with:

I would like to run the program that I've built, but I get the window message "This application has failed to start because <library name>.dll was not found". I know that this means that I haven't specified the path to dll's that I'm linking with. How do I do that?
I'm linking with several dll's, each in its different directory. I've correctly built the executable, specifying the lib*.a for each shared library in Project's "Settings...->Linker->Library Path" and "Libraries". The Dll for each library is in the same directory as its "lib*.a file" (this was enough for CodeBlocks to find the dll file when attempting to run the program).

Can anyone help? Thanks in advance

Re: Specify DLL Library path

Posted: Mon Sep 27, 2010 10:23 am
by eranif
The best way to do that is:
'settings -> environment variables'
and add to the workspace environment variables (if you never touched that, then it should be the 'Default' one) the following line:

Code: Select all

PATH=\Path\To\My\Dlls;$(PATH)
(ofc, replace \Path\To\My\Dlls with the actual path)

Eran

Re: Specify DLL Library path

Posted: Mon Sep 27, 2010 5:26 pm
by TurboLento
Brilliant, that worked perfectly!

Have you considered/are you considering letting the user specify environment variables by workspace/project instead of globally? I think that might be useful.

Thanks for the help and for creating CodeLite!

Re: Specify DLL Library path

Posted: Mon Sep 27, 2010 7:17 pm
by eranif
TurboLento wrote:Have you considered/are you considering letting the user specify environment variables by workspace
right click on your workspace and select 'Workspace Setting -> environment'
TurboLento wrote:project instead of globally?
This is already implemented in trunk version, each project (actually each project configuration) can use a different set of environment variables (and debugger predefined types)

Eran

Re: Specify DLL Library path

Posted: Tue Sep 28, 2010 12:27 am
by TurboLento
Fantastic! Thanks for the help!