User forums > Using Code::Blocks

Working with 2 versions of a library

<< < (2/2)

Jenna:

--- Quote from: stahta01 on February 29, 2012, 01:14:02 pm ---
--- Quote from: ote on February 29, 2012, 12:36:59 pm ---Or is there a way to have the same .cpp and .h files in two projects ?

--- End quote ---

Yes, you can you the same .cpp and .h files in two projects. You will need to use different target names to prevent the object files over writing each other. Or use some other method to keep the object files separate.

Tim S.

--- End quote ---

Just use different object output directories in the projects properties.

ote:
thanks for your advice. Finally, the simplest way I find for doing what I want, is to create just on build target and made a bash script which parse the project.cbp and change the folder name of the include file depending on which version of the library I want to work with.

When I want to switch, I just have to call that script from a console and C::B ask me if I want to reload the project. Maybe not the more official way of doing, but very effective.

oBFusCATed:
Here is the official way to do this: http://wiki.codeblocks.org/index.php?title=Global_compiler_variables
Seems better to me :)

Navigation

[0] Message Index

[*] Previous page

Go to full version