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!
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.
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.
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?
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!
If you have the old project file you can compare it to the new one to see what is the difference.
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>
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?
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!
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.