Author Topic: cbp2make usage question  (Read 2551 times)

Offline crankypuss

  • Single posting newcomer
  • *
  • Posts: 6
cbp2make usage question
« on: March 10, 2017, 12:07:47 am »
Two projects in workspace, a static lib and a console executable.  I've run cbp2make --with-deps, and when building the executable the static lib has to have been built first or it complains that there's no rule to make the library.  Under C::B building the test executable also builds the library.  If i make the library first, the test executable is built just fine using the makefile.  So although the makefile built by cbp2make works, and recognizes that it needs to include the static lib, it doesn't know how to build it.

Can anyone tell me if this is operating as expected, or if not, how i change things so the lib gets built before the test executable?  thanks.

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: cbp2make usage question
« Reply #1 on: March 10, 2017, 04:59:10 am »
Under project settings there is a button "project dependencies" that should fix your problem

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline crankypuss

  • Single posting newcomer
  • *
  • Posts: 6
Re: cbp2make usage question
« Reply #2 on: March 10, 2017, 10:15:50 am »
From the main menu there is a Project/Properties selection, i assume that is what you refer to?  It has a "project's dependencies" button that brings up a small dialog in which the library is checked.

From the Project/Properties dialog which has the "project's dependencies" button, one can also select the "build targets" tab, which shows the builds (debug/release) on the left, and has a "Dependencies" button; when clicked that brings up another "external dependencies" dialog where one can add/edit either "additional output files" or "external dependency files".  The library is also listed there as an "external dependency" file.

The word "dependency" seems to have (at least) two meanings, one meaning pre-requisite projects, the other meaning files required by the link.  I admit to finding this somewhat confusing.

When building the executable from within c::b there are no apparent issues.  But the makefile generated for the main project (the executable rather than the library) does not also build the pre-requisite library.  It knows it should, but has no rule telling how it is to be built.  Theoretically if c::b builds the library and the executable when a library member has changed, it seems like the makefile should do the same thing.

It isn't and i'm not sure why.  Thanks.

Offline crankypuss

  • Single posting newcomer
  • *
  • Posts: 6
Re: cbp2make usage question
« Reply #3 on: March 25, 2017, 11:26:23 pm »
Not sure what the problem was.  Probably an indication that i needed to organize the code differently.

In any case it's no longer a problem, do you folks mark threads "SOLVED", and if so how?

I'll try "lock this topic", that's the closest i can find.  With a thumb-up icon.  Thanks.