Author Topic: static libraries  (Read 3070 times)

typek

  • Guest
static libraries
« on: December 17, 2005, 05:58:38 pm »
I would like to "Run" my static library project. When I try to run it (by clicking on the blue arrow), CodeBlocks asks me to select the host application. I just don't know how to select it.
The second problem is that I want the project (some application, GUI or console) to rebuild when one or more of the libraries which the project uses changes. (When I click on the "Build and Run" button, it only runs, no rebuilding although some libraries have changed.)
I work on windows.
Thanks,
typek
« Last Edit: December 17, 2005, 06:00:30 pm by typek »

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: static libraries
« Reply #1 on: December 17, 2005, 06:26:53 pm »
I would like to "Run" my static library project. When I try to run it (by clicking on the blue arrow), CodeBlocks asks me to select the host application. I just don't know how to select it.

Project -> Set program's arguments, fill in the "Host application" textbox while your library target is selected.

Quote
The second problem is that I want the project (some application, GUI or console) to rebuild when one or more of the libraries which the project uses changes. (When I click on the "Build and Run" button, it only runs, no rebuilding although some libraries have changed.)

Project -> Properties -> targets -> $(YOUR_APP_TARGET), add the static libraries linked to it as external dependencies.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5157
Re: static libraries
« Reply #2 on: December 17, 2005, 06:28:27 pm »
Project menu -> Set program arguments : Host application -> together with full path (maybe relative might work).

Maybe we should allow the use to browse for the exe, instead of typing in the complete path.

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: static libraries
« Reply #3 on: December 17, 2005, 06:51:38 pm »
Project menu -> Set program arguments : Host application -> together with full path (maybe relative might work).

Maybe we should allow the use to browse for the exe, instead of typing in the complete path.

Relative paths work. I think $(APPTARGET_OUTPUT_FILE) (if your application target is named AppTarget) should work as well, and it has the benefit of continuing to do so if you decide to use another name and/or path for your executable.
Also, good point about the browse button.

typek

  • Guest
Re: static libraries
« Reply #4 on: December 17, 2005, 09:51:24 pm »
Maybe I understand this badly but when I change and recompile the source of my library, it doesn't affect the host application at all. Maybe this is a stupid question, but how can then I check whether my library is working or not? For what are the host applications really used?
I tried to use two build targets, but then I was asked which of these targets to run, so I would like to set this only once as well if possible...
Thank you,
typek

PS: I couldn't find any user manual on CodeBlocks, is something available?