News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

C::B keeps recompiling certain files

Started by marshiell, February 25, 2015, 09:18:06 PM

Previous topic - Next topic

marshiell

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!


oBFusCATed

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!]

cacb

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.

marshiell

#3
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?

marshiell

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!

oBFusCATed

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!]

marshiell

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>

oBFusCATed

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!]

marshiell

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!

marshiell

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.