Specify DLL Library path

General questions regarding the usage of CodeLite
TurboLento
CodeLite Enthusiast
Posts: 12
Joined: Mon Sep 27, 2010 2:51 am
Genuine User: Yes
IDE Question: c++
Contact:

Specify DLL Library path

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Specify DLL Library path

Post 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
Make sure you have read the HOW TO POST thread
TurboLento
CodeLite Enthusiast
Posts: 12
Joined: Mon Sep 27, 2010 2:51 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Specify DLL Library path

Post 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!
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Specify DLL Library path

Post 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
Make sure you have read the HOW TO POST thread
TurboLento
CodeLite Enthusiast
Posts: 12
Joined: Mon Sep 27, 2010 2:51 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Specify DLL Library path

Post by TurboLento »

Fantastic! Thanks for the help!
Post Reply