Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: johne53 on April 29, 2007, 09:39:15 am

Title: Dependencies
Post by: johne53 on April 29, 2007, 09:39:15 am
So far, I've only created a simple "Hello World" type application. But suppose I wanted to create a more complex project where (say) an executable is dependent on one or more libs. How is this done using C::B? Do the libs have to be in their own project or can one project have several branches? And how do I mark a project (or branch) as being dependent on another?
Title: Re: Dependencies
Post by: johne53 on April 29, 2007, 01:12:09 pm
A popup tool tip just appeared telling me that one project can have many build targets - such as a static library and also an application that uses the library. Can anyone expand on that and tell me how it's done?
Title: Re: Dependencies
Post by: TDragon on April 29, 2007, 03:58:40 pm
Take a look at the Build targets section of your project's properties dialog. The list of targets is on the left; you can add and remove targets from it. Each target's properties are displayed on the right. Rather than trying to make C::B track inter-target dependencies, you merely rearrange the order of the targets so the ones that are depended on come first. You can also create "Virtual Targets", which merely specify a subset of all the project's targets to be built.

Hope that helps,
John E. / TDM