Author Topic: dependency checking again ....  (Read 4163 times)

Offline simonl

  • Single posting newcomer
  • *
  • Posts: 7
dependency checking again ....
« on: December 01, 2008, 06:04:53 pm »
I know this was aired sometime back but the answers didn't really address the issue.  Suppose a.cpp contains #include <b.h> and b.h contains #include <c.h>.  A change to c.h may require a.cpp be be rebuilt even though neither a.cpp nor b.h have changed.

Using make directly I can deal with this by automatically generating the complete dependencies (see e.g.  http://make.paulandlesley.org/autodep.html - though in practice the gcc -M option isn't as convenient as I'd like or http://en.wikipedia.org/wiki/Makedepend) making the build detect a program needs to be rebuilt rather than expecting the programmer to plow through everything to sort out dependencies.

As far as I can see C::B doesn't do this ... or does/can it?

Simon

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: dependency checking again ....
« Reply #1 on: December 01, 2008, 07:27:04 pm »
Can you create a simple test-project where the problem occurs ?

I created a test project, where main.cpp includes test.h and test.h includes test_2.h.
test_2.h is not part of my project, but test.h is.
Inside test_2.h I have a function printing on stdout.

If I now change test_2.h the appropriate part of the program gets recompiled and the output is as expected.

Offline simonl

  • Single posting newcomer
  • *
  • Posts: 7
Re: dependency checking again ....
« Reply #2 on: December 01, 2008, 09:59:56 pm »
Embarassing apology - I couldn't see why it didn't work for me until I realised C::B doesn't save open changed files before building.  When I remembered to save the file I'd modified, the build did detect the change.

I'm really impressed with C::B - and the support is so rapid.  No more Eclipse or NetBeans for me.

Sorry to have wasted your time.


Simon

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: dependency checking again ....
« Reply #3 on: December 01, 2008, 10:11:13 pm »
Embarassing apology - I couldn't see why it didn't work for me until I realised C::B doesn't save open changed files before building.  When I remembered to save the file I'd modified, the build did detect the change.

If the file is not saved, it is included into the project to be build.

C::B normally saves all project-files (at least sources and headers) before building.