Author Topic: CB settings for Template with DLLs  (Read 4996 times)

Offline proomer

  • Single posting newcomer
  • *
  • Posts: 4
CB settings for Template with DLLs
« on: September 26, 2014, 10:16:56 pm »
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CB settings for Template with DLLs
« Reply #1 on: September 26, 2014, 11:01:31 pm »
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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline proomer

  • Single posting newcomer
  • *
  • Posts: 4
Re: CB settings for Template with DLLs
« Reply #2 on: September 26, 2014, 11:21:32 pm »
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.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: CB settings for Template with DLLs
« Reply #3 on: September 26, 2014, 11:31:25 pm »
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.

Offline proomer

  • Single posting newcomer
  • *
  • Posts: 4
Re: CB settings for Template with DLLs
« Reply #4 on: September 26, 2014, 11:59:51 pm »
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?

Offline edison

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: CB settings for Template with DLLs
« Reply #5 on: September 27, 2014, 03:14:52 am »
I had create a wizard.script for SDL2 which need some dlls file too, I did add this line in the wizard.script's "if (PLATFORM == PLATFORM_MSW)" section, then when building the sdl2 project, CB will call xcopy to copy the .dlls in to the project folder:
Code
project.AddCommandsAfterBuild(_T("XCOPY $(#sdl2)\\bin\\*.dll $(TARGET_OUTPUT_DIR) /D /Y"));

but I dont know how to delete the .dll files when cleaning project.

Offline proomer

  • Single posting newcomer
  • *
  • Posts: 4
Re: CB settings for Template with DLLs
« Reply #6 on: September 27, 2014, 08:31:48 am »
Thanks - that will work. Great!

Cheers,
Peter