Menu

Recompile files affected by change to .H ??

2002-10-29
2012-09-26
  • Nobody/Anonymous

    I have a problem that changes to .H files do not automatically result in a recompilation of all the .CPP's that #include that header file. I have to click REBUILD ALL to effect the changes. I have been caught out a few times during debugging and I was wondering if there was something I missed in DEV-C++ options. I have actually had this same problem in other IDE's as well.

    Perhaps there is a technical reason for this, but I thought it would be pretty easy just to search all the .CPP files in the project to see if they were dependant on the header that changed.

    I hope I am not being ridiculously stupid with this question.

    BlakJak  :]

     
    • Nobody/Anonymous

      I'm probably the stupid one, as I still do a make clean: make just to make sure everything gets picked up right.  I always thought it was force of habit and it takes longer, giving me more time to goof off.

      ;-)

      Wayne

       
    • Nobody/Anonymous

      You could turn off "Use fast but imperfect dependency generation" under the compiler options. I haven't really tested this, but it should work. However, as you can probably deduce, it will be slower.

       
      • Nobody/Anonymous

        I believe I tried this before and it didn't work. I will try again and let people know.

        BlakJak :]

         
    • Nobody/Anonymous

      This may not be the right answer, but I'll try anyway. I've noticed that if I make changes to a .h file, (such as a .h for a class, then make changes to the corresponding .cpp (or not)) I have to hit the little 'save' icon, so the changes are saved, then when I recompile the 'main' file, I'm o.k. If I don't save the changed file, it doesn't seem to pick up the changes.

       
      • Nobody/Anonymous

        Well I did my test today I can confirm that remove the tick on the Fast But Imperfect Dependencies does not help this problem.

        Could be a request for imporvement.

        BlakJak :]

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.