Author Topic: Different type Build targets in the same Project  (Read 2544 times)

Offline OzzyR21

  • Single posting newcomer
  • *
  • Posts: 7
Different type Build targets in the same Project
« on: October 13, 2017, 04:05:01 pm »
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

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Different type Build targets in the same Project
« Reply #1 on: October 13, 2017, 05:10:40 pm »
Quote
I 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....
Quote
only 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...

Offline OzzyR21

  • Single posting newcomer
  • *
  • Posts: 7
Re: Different type Build targets in the same Project
« Reply #2 on: October 13, 2017, 05:16:48 pm »
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.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Different type Build targets in the same Project
« Reply #3 on: October 13, 2017, 05:26:50 pm »
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