User forums > Using Code::Blocks
CB settings for Template with DLLs
proomer:
I want to set up a user template in CB for a special project. Unfortunately I have some dependencies, some DLLs that are needed at execution. The libs I can just put in a lib folder. However I would like to put all DLLs in a bin folder somewhere, but I cannot figure out how to set this up in CB or even if it is possible. I am using CB 13.12 with TDM-GCC x64 on Win 8.1. Any help appreciated!
Cheers,
Peter
oBFusCATed:
Do you just need to copy some files from the place where the template is to the actual project?
Have you inspected the code for other templates if they are not doing something similar?
proomer:
Yeah, copying the DLLs to bin/release and bin/debug would probably work, if that could be done automatically each time I use the template. I can't find any of the wizard scripts doing this though. Perhaps I am missing something? Alternatively perhaps Windows/Linux have some way to set a path to the DLLs in the code meaning I would use the same folder for the DLLs.
scarphin:
The 'bin' setting in the global variables does what you need if you are using (a) library dll(s). Just set the 'bin' setting to the folder which your dlls reside (I believe you must be using the global variable to point to your libraries somewhere in your project). Be aware that it won't work if you run your executable from outside CB. An alternative is to use 'post build steps' to copy the dlls after compilation automatically to make sure they are in the same folder as the executable. Or you can insert another entry in system path pointing to your dlls as a 3rd option.
proomer:
Thanks, great options. I am leaning towards a post build step. However, I couldn't find any useful info in the help file on how to copy files from a 'bin' folder containing the dlls to the bin/release and bin/debug - any suggestions?
Navigation
[0] Message Index
[#] Next page
Go to full version