Author Topic: setting a dll path  (Read 10186 times)

Offline Acki

  • Multiple posting newcomer
  • *
  • Posts: 100
setting a dll path
« 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

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: setting a dll path
« Reply #1 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: setting a dll path
« Reply #2 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Acki

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: setting a dll path
« Reply #3 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:

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:
« Last Edit: March 24, 2008, 10:10:54 pm by Acki »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: setting a dll path
« Reply #4 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.
Be patient!
This bug will be fixed soon...

Offline Acki

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: setting a dll path
« Reply #5 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... ;)