Author Topic: Why not copy dynamic(DLL) file automatically to  (Read 5032 times)

Offline marcus1877

  • Single posting newcomer
  • *
  • Posts: 8
Why not copy dynamic(DLL) file automatically to
« on: May 27, 2014, 11:38:35 am »
  ???
As a developer from C#, These days i'm trying to get farmilar with CodeBlocks.
I'm curious of why there's no machanism to search DLL file automatically, as same as Linker/Compiler do.
Maybe my question is a bit goofy , could any one help me out???
My question is provoked from below experience about boost:

When i downloaded and compiled boost(www.boost.org) , i tried to write a sample with Regex. Then in CodeBlocks i set the 'Search directories'  for Linker and Compiler .
All I thought was CodeBlocks will find all needed files at those path.
However when i launch the sample , it told me that "a xxx.dll not found".
It took me several hours to find out the solution: copy the coresponding dll file to executable directory(debug/release). This dll file is exactly located at where the lib file is.
Why don't CodeBlocks search dll at directories specified ???
Or maybe it's the compiler who loads the lib and then search for dll , but CodeBlocks could told compiler where to position these dll files , Couldn't it ????



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7665
    • My Best Post
Re: Why not copy dynamic(DLL) file automatically to
« Reply #1 on: May 27, 2014, 01:24:31 pm »
Why don't CodeBlocks search dll at directories specified ???


I thought CB already did this.
Please post the full re-build log of a CB project where it fails.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Please mention CB version and OS name and version.
And, how you are running the program.

Tim S.
« Last Edit: May 27, 2014, 01:41:42 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline marcus1877

  • Single posting newcomer
  • *
  • Posts: 8
Re: Why not copy dynamic(DLL) file automatically to
« Reply #2 on: May 28, 2014, 03:37:42 am »
Sorry forgot posting environment info. And cause this issue isn't reproduced , i have to close it.
I tried to reinstall CodeBlocks to reproduce and failed. All go so well without even a bit warning.

CodeBlock:13.12 , Win7 32bit, CS

Offline Guuestgulkan

  • Single posting newcomer
  • *
  • Posts: 6
Re: Why not copy dynamic(DLL) file automatically to
« Reply #3 on: June 10, 2014, 08:32:39 pm »
  ???
As a developer from C#, These days i'm trying to get farmilar with CodeBlocks.
I'm curious of why there's no machanism to search DLL file automatically, as same as Linker/Compiler do.
Maybe my question is a bit goofy , could any one help me out???
My question is provoked from below experience about boost:

When i downloaded and compiled boost(www.boost.org) , i tried to write a sample with Regex. Then in CodeBlocks i set the 'Search directories'  for Linker and Compiler .
All I thought was CodeBlocks will find all needed files at those path.
However when i launch the sample , it told me that "a xxx.dll not found".
It took me several hours to find out the solution: copy the coresponding dll file to executable directory(debug/release). This dll file is exactly located at where the lib file is.
Why don't CodeBlocks search dll at directories specified ???
Or maybe it's the compiler who loads the lib and then search for dll , but CodeBlocks could told compiler where to position these dll files , Couldn't it ????


I think you are confused a bit here.
The search directories specified during  for linker and compiler are for the compiler and linker to find include files and import library files respectively
when the program is being built.

if you get the error "a xxx.dll not found" when  launching or trying to run a program  then that is a Windows
issue.
Windows search for DLLs in certain places - and if it does not find the DLL in any one
of those places it will spit out that error.

See here ( on MSDN which gives  the places where Windows looks for DLLs)
http://msdn.microsoft.com/en-us/library/7d83bc18.aspx