Author Topic: Dependency Checking & chaning of .h files.  (Read 15923 times)

staloysius333

  • Guest
Dependency Checking & chaning of .h files.
« on: October 10, 2005, 05:23:44 pm »
Hi.  I have noticed that CBs does not appear to catch when a .h file has been changed and does not re-compile the .cpp files automatically  that depend on it.  How do I get CBs to notice when a .h has changed and re-compile ALL .cpp files that depend on it?  Thanks so much!  I've searched for an answer to this question but I am unable to find one.  Sorry if this is a repost.  I hope it's not. :D

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Dependency Checking & chaning of .h files.
« Reply #1 on: October 10, 2005, 05:45:49 pm »
Platform?
Build method? (Settings->Compiler->Other->Build method)
Be patient!
This bug will be fixed soon...

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #2 on: October 10, 2005, 05:55:24 pm »
Platform: WinXP,  Build method? Humm.... "Invoke Compiler directly"

Does this help?

--Allen

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Dependency Checking & chaning of .h files.
« Reply #3 on: October 10, 2005, 07:03:40 pm »
Platform: WinXP, Build method? Humm.... "Invoke Compiler directly"

Does this help?

Hmm, the "direct mode" is known to work flawlessly as far as dependencies are concerned. I find it odd that it's not working for you. It's the first time I hear this and I have never noticed it myself...
Can you post your project file?
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Dependency Checking & chaning of .h files.
« Reply #4 on: October 10, 2005, 11:47:47 pm »
Maybe the .h file in question is NOT included in the project...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Dependency Checking & chaning of .h files.
« Reply #5 on: October 11, 2005, 12:18:11 am »
Maybe the .h file in question is NOT included in the project...

It doesn't matter. The dependency checker scans each file and checks the #included files' modification dates. The only thing that matters is the compiler include dirs being correctly set-up (so that the checker can locate the files - if it doesn't, it assumes they 're not updated).
Be patient!
This bug will be fixed soon...

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #6 on: October 11, 2005, 05:36:14 pm »
Humm, I know the .h files are in the project correctly, else none of my code would compile at all or build.  Unfortunately, I can not post my project because it is "sensitive" to my company's growth.  But I can give screen shots of my set up.  Here they are.  If I have incorrectly setup the header info - or anything else - please, let me know.  I'll change what I'm doing ASAP.  Thanks so much for the help.  It is MuCH appreciated!  :D

I have nothing in "Custom Variables".  The Screen shots I've included are of my compiler setup as well as my project setup.  Also, it is good to know, my "Headers" are all "summed up" in ONE header that is included in all of my .cpp files.  Another words, in my cpp's, I include only one header, which includes all of the other headers needed by all the source code files.  Is that a problem?

(This is going to be hard.  I have a Lot of screen shots but can only post - it seems - one at a time.

--Allen

[attachment deleted by admin]

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #7 on: October 11, 2005, 05:37:39 pm »
More screen shots.

[attachment deleted by admin]

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #8 on: October 11, 2005, 05:38:18 pm »
more shots

[attachment deleted by admin]

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #9 on: October 11, 2005, 05:38:45 pm »
more...

[attachment deleted by admin]

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #10 on: October 11, 2005, 05:39:19 pm »
more

[attachment deleted by admin]

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #11 on: October 11, 2005, 05:40:22 pm »
Thank you for all the help guys!  :D

Sincerely, Allen

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Dependency Checking & chaning of .h files.
« Reply #12 on: October 11, 2005, 06:34:40 pm »
Question - where is the file-in-question located? Mind showing the modification datetime? The compile log?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Dependency Checking & chaning of .h files.
« Reply #13 on: October 11, 2005, 06:40:26 pm »
Quote
(This is going to be hard.  I have a Lot of screen shots but can only post - it seems - one at a time.

In the "reply" form, click "additional options" (you did that to attch a file) and click "more attachments" to add more than one file...

Quote
Thank you for all the help guys!

I see that you 're using the global compiler options to setup your project. That is plain wrong. In global options you should put settings that should be, err, global  :shock:

Try setting the project and target options, available through "Project->Build options" and remove those settings from the global options (I 'm talking about compiler flags, includes, libs, etc).
I bet that your problem will be solved.
Be patient!
This bug will be fixed soon...

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #14 on: October 14, 2005, 04:54:47 pm »
Ok, thank you.  File in question.  Compile logs.  Lets see what can do....  & about the global stuff, that sounds really good.  I'll be sure to try that.  Ah, the files in question, the Compile log will, of course, only show what's been compiled but the files in question are my headers.  One header contains all the others, itfp.h.  I'll attached a pic of that too.  I hope this makes it in this post.  The last ones forced me to make multiple posts because of the "size" of the pics.



[attachment deleted by admin]

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Dependency Checking & chaning of .h files.
« Reply #15 on: October 14, 2005, 05:19:37 pm »
Thank you, but we'd appreciate it if the screenshots were legible the next time :lol:

Anyway, try to enable the "Full Commandline" logging in the compiler advanced options. Also, the compiler log can be copy / pasted with right-click.

grv575

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #16 on: October 15, 2005, 02:06:40 am »
Just reading through this, it sounds like the dependency checker checks .c .cpp etc files for #includes and ensures recompilation if any of them have changed.

But is this recursive?  If a header not directly #included in a .c .cpp file but (#included in an #included header), then does it catch this or no?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Dependency Checking & chaning of .h files.
« Reply #17 on: October 15, 2005, 09:38:03 am »
As said before, of course it's recursive. But the compiler include dirs for the project must be setup correctly so that it can really locate the files...

I 've told it before: set the project include dirs correctly and it 'll work. The dependency checker does not follow global include dirs...
Be patient!
This bug will be fixed soon...

grv575

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #18 on: October 16, 2005, 01:28:58 am »
OK, but say I don't set the include dir for each file I include, but I add them to the project.  Will the recursive #include checking look here as well (I assume yes but just to be sure)?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Dependency Checking & chaning of .h files.
« Reply #19 on: October 16, 2005, 10:09:00 am »
OK, but say I don't set the include dir for each file I include, but I add them to the project. Will the recursive #include checking look here as well (I assume yes but just to be sure)?


I 'll say it in a different way: dependency-checking is reliable and works as long as your project compiles without errors about missing #includes.
In other words:  if the compiler can find your files, C::B can too. The only difference is that C::B will not search in dirs defined in the global compiler options.

I hope it's clear enough now.
Be patient!
This bug will be fixed soon...

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #20 on: October 17, 2005, 05:08:42 pm »
Cool,  now I begin to understand.  The project must be set up correctly & ! the Global prefs.  Ok, thanks.  That, I believe answers my ? and I'll certainly try that.

About the "unreadable" jpg. Sorry, but that's the biggest I could get it to be accepted by the site.  I only allows a 128k size pic and mine was acutally around 3k in size.  Ah well,

Thanks so much for the insight.  I'll certainly try it!  :D

--I also appreicate you patience & willingness to answer my ?'s.   8)

--Allen

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Dependency Checking & chaning of .h files.
« Reply #21 on: October 17, 2005, 05:33:28 pm »
About the "unreadable" jpg. Sorry, but that's the biggest I could get it to be accepted by the site.  I only allows a 128k size pic and mine was acutally around 3k in size.  Ah well,

Try www.imageshack.us next time :)

1024kb max. filesize, free of charge, plus it saves bandwidth and storage for the forums ;)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

staloysius333

  • Guest
Re: Dependency Checking & chaning of .h files.
« Reply #22 on: October 17, 2005, 06:39:58 pm »
Never heard of it!  Way cool & then I wouls suspose that I'd put in a link to it so that the pic can be seen.

Excellent!  :D

--Allen