User forums > Using Code::Blocks

Different type Build targets in the same Project

(1/1)

OzzyR21:
Hi all

I wonder if it is possible for example to build both a Console Executable and a Static Library  , Building the same project.
I tried to add Different Build Targets , setting different type Build and export files , but when rebuilding , only the default Debug/Release targets seem to work.

Thank you

BlueHazzard:

--- Quote ---I wonder if it is possible for example to build both a Console Executable and a Static Library  , Building the same project.
--- End quote ---
Of corse it is possible. Codeblocks does it in his own project....

--- Quote --- only the default Debug/Release targets seem to work.
--- End quote ---
what does this mean?
describe the problem more... Is the build not updated? Are compiling errors? Are executable crashes? Does not work is not a adequate description of a problem...

OzzyR21:
Well actually
I add one more Build Target , I set an output filename /lib/myLibrary.a
I rebuild it.I take ===Build finished
I have a new executable in bin folder.
But nothing in lib folder I am excepting to have the .a file.
I am completely rookie both in Code::Blocks and C.

Thank you.

BlueHazzard:
still not enough information... lets try this:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Can you post the project file?

The general approach:
Project->Properties->Build targets->Add
Set all settings accordingly
Do not forget to select the files from "Build target files"
Hit ok.
Select target from the drop down menu near the build buttin
Hit build

If you want to build all library targets at once but not the executable, create a virtual target:
Project->Properties->Build targets->Virtual targets

Navigation

[0] Message Index

Go to full version