News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Different type Build targets in the same Project

Started by OzzyR21, October 13, 2017, 04:05:01 PM

Previous topic - Next topic

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

QuoteI wonder if it is possible for example to build both a Console Executable and a Static Library  , Building the same project.
Of corse it is possible. Codeblocks does it in his own project....
Quoteonly the default Debug/Release targets seem to work.
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