Author Topic: C::B keeps recompiling certain files  (Read 3204 times)

Offline marshiell

  • Single posting newcomer
  • *
  • Posts: 6
C::B keeps recompiling certain files
« on: February 25, 2015, 09:18:06 pm »
Hi,
I recently updated my CodeBlocks and mingw. Now every time I edit a single file (.cpp), 15 others keep being rebuilt when I press build. It's always the 15 same! How do I fix that? It's really annoying to have to wait 20s for compiling when I just edited a single line in a single file

I'm using Code Blocks 13.12 on Windows 7

Thanks!


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B keeps recompiling certain files
« Reply #1 on: February 25, 2015, 09:35:02 pm »
Have you check the modification times of these source files?
The build system uses the last modification time to decide if a file should be rebuild or not.
If the times are in the future then you'll have this problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: C::B keeps recompiling certain files
« Reply #2 on: February 25, 2015, 09:40:13 pm »
Hi, I have observed something similar, although I don't have quite as stringent description as yours. But I have noticed that sometimes I get recompilation for no apparent reason. To be more precise I am editing in one project and another one that it depends on gets recompiled when I press build. When it is finished I can press build and it builds again.

At least that is what I think has been going on. This was on Win7 using MSVC2010 compiler and C::B nightly 10091, I believe.

I cannot reproduce easily, but I would like to confirm seeing what I think is reported in this thread.

Offline marshiell

  • Single posting newcomer
  • *
  • Posts: 6
Re: C::B keeps recompiling certain files
« Reply #3 on: February 25, 2015, 09:50:26 pm »
Modification dates are in the past.

Also the rebuilding of those files only happen when I edit specific files.
I'll try to be as clear as I can: when I edit some files from the group A, files from group B get rebuilt again even with no modification in them. Then they are files from group C that don't cause any other file to rebuilt and that don't get rebuilt when they don't have any modification (normal behaviour).
Maybe files from group A and files from group B have some sort of connection somehow?

Anyway this whole thing didn't happen before I updated C::B and MinGW. Maybe some settings were modified during this process?
« Last Edit: February 25, 2015, 09:52:32 pm by marshiell »

Offline marshiell

  • Single posting newcomer
  • *
  • Posts: 6
Re: C::B keeps recompiling certain files
« Reply #4 on: February 25, 2015, 11:14:09 pm »
I just created a new project and added my source files in it and it works fine now!!
Sorry for the inconvenience and thanks for the support!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B keeps recompiling certain files
« Reply #5 on: February 26, 2015, 12:14:51 am »
If you have the old project file you can compare it to the new one to see what is the difference.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline marshiell

  • Single posting newcomer
  • *
  • Posts: 6
Re: C::B keeps recompiling certain files
« Reply #6 on: February 26, 2015, 12:19:33 am »
The only relevant difference I see is this in the old project file:

Quote
      <Compiler>
         <Add option="-Wall" />
      </Compiler>
      <Linker>
         <Add library="mingw32" />
         <Add library="SDLmain" />
         <Add library="C:\Program Files (x86)\CodeBlocks\SDL-1.2.15\lib\libSDL.dll.a" />
         <Add library="user32" />
         <Add library="gdi32" />
         <Add library="winmm" />
         <Add library="dxguid" />
         <Add library="C:\Program Files (x86)\CodeBlocks\MinGW\lib\libws2_32.a" />
         <Add directory="C:/Program Files (x86)/CodeBlocks/SDL-1.2.15/lib" />
      </Linker>

While there's that in the new project file:
Quote
      <Compiler>
         <Add option="-Wall" />
         <Add directory="C:/Program Files (x86)/CodeBlocks/SDL-1.2.15/include" />
      </Compiler>
      <Linker>
         <Add library="mingw32" />
         <Add library="SDLmain" />
         <Add library="SDL.dll" />
         <Add library="user32" />
         <Add library="gdi32" />
         <Add library="winmm" />
         <Add library="dxguid" />
         <Add library="C:\Program Files (x86)\CodeBlocks\MinGW\lib\libws2_32.a" />
         <Add directory="C:/Program Files (x86)/CodeBlocks/SDL-1.2.15/lib" />
      </Linker>

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B keeps recompiling certain files
« Reply #7 on: February 26, 2015, 12:49:24 am »
The only difference I can see is that you have sdl.dll in the lib list.
What happens if you add it to the working projected?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline marshiell

  • Single posting newcomer
  • *
  • Posts: 6
Re: C::B keeps recompiling certain files
« Reply #8 on: February 26, 2015, 11:41:37 pm »
It's apparently not the problem. I can't seem to find the source of the issue so I'll just post my project files.

As attachement:
-"psnblal.cbp", the problematic project file.
-"bho.cbp", the new and working project file.

When I copy paste the old .cbp in the new one, the problem comes back. This is really weird!

Offline marshiell

  • Single posting newcomer
  • *
  • Posts: 6
Re: C::B keeps recompiling certain files
« Reply #9 on: February 27, 2015, 09:49:10 pm »
I just figured it out, this was due to the auto versioning. The version.h file is edited for each build and some of my files were including it.