Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Acki on March 21, 2008, 01:17:30 am

Title: setting a dll path
Post by: Acki on March 21, 2008, 01:17:30 am
Hi,
I wonder how to set a dll path in C::B ???
I mean like with wxWidgets, I installed it a view days ago and mentioned that I don't have to copy any wx dlls to the exe folder when running the exe in C::B, only if I try to run the exe directly in the folder I need to copy the needed dlls to this folder (or win\system)!
So I think there is an option to set dll pathes for the current project so it can find the dlls, but I couldn't find such ???

thx, Acki
Title: Re: setting a dll path
Post by: Seronis on March 21, 2008, 01:36:49 pm
This should really be posted in 'Help' or  'Using CodeBlocks' and not  'Help Wanted'

Quote
Help wanted
Would you like to contribute to Code::Blocks? Here are some "bounties" which you may want to collaborate with: beta-testing,documentation,solving hard bugs or adding features.
Title: Re: setting a dll path
Post by: MortenMacFly on March 24, 2008, 08:16:18 pm
You can setup the path where to run the project's executable from within the projects options: tab "build targets" -> select your target -> select "Execution working directory". Choose the path of your required DLL there.
Title: Re: setting a dll path
Post by: Acki on March 24, 2008, 10:07:58 pm
but this will cause problems when I need to access files in the app dir, wouldn't it ???
also the wx project doesn't do it this way:
(http://passist.g0dsoft.com/project.jpg)
and just to be clear, it's the standard wx project you can select from the project wizard...

also let's say I need different dlls that are placed in different folders, how to do it then ???

it's prety strange nobody knows how to do this... :shock:
but someone must have done this project wizard for wxWidgets, maybe he's the only one who knows how to do this ??? :lol:
Title: Re: setting a dll path
Post by: mandrav on March 24, 2008, 11:16:08 pm
I wonder how to set a dll path in C::B ???

All dirs entered in "linker search dirs" (in project build options), are added to PATH (only while executing your program within C::B) so they 're also searched for DLLs.
Title: Re: setting a dll path
Post by: Acki on March 25, 2008, 03:58:11 pm
great, that's exactly what I'm looking for !!!
thank you very much !!! :)
I thought this was only for libs and doesn't work for dlls, too (I didn't know it adds to the PATH)...  :oops:
now it's also clear why wxWidgets works, because the dlls are in the same folder like the libs... ;)