User forums > Using Code::Blocks
Used to auto-build when adding new files, but not anymore?
AntiElephant:
It used to be that if I swapped files in and out of my project and pressed F9 then it would update and auto-build with the new files completely.
However I updated to a new compiler (mingw-w64 GCC 5.2.0) and suddenly it won't auto build. If I take a file out of my project and add a new one in, press F9, then it always says in the build log:
"Target is up to date.
Nothing to be done (all items are up-to-date)."
And the program runs like I still have the old source files. There was no compiling done. I have to click "Rebuild" every time for it to register the change in files. I even tried uninstalling the new compiler and swapping back to codeblocks's default but I still have the error.
I must have clicked a setting accidentally which prevents the rebuilding when pressing F9.
What could the issue be?
oBFusCATed:
As far as I know this works fine.
Can you make a sample project and post the steps to reproduce the problem?
And what version are you using?
AntiElephant:
--- Quote from: oBFusCATed on December 09, 2015, 05:28:26 am ---As far as I know this works fine.
Can you make a sample project and post the steps to reproduce the problem?
And what version are you using?
--- End quote ---
I'm using 13.12 but it was working fine at one point.
http://imgur.com/a/KkPsq
There are a few screenshots.
In the first screenshot test.cpp is part of the project "Primer" and pressing F9 brings up the console with the desired output.
Then I remove test.cpp and add EX17.15.cpp to the project. This is a different source file with different output, but pressing F9 still brings up the console with output from the previous (i.e. test.cpp) source file. It hasn't compiled anything new, and it says at the bottom left that the target was up to date.
The only way to rectify this is to right click the project and say "rebuild", but I never had to do that before.
Third screenshot shows my compiler settings, but again it happens with even the default GCC compiler.
(Actually as I've discovered, if I were to change EX17.15.cpp in any way [e.g. by adding a comment] and then press F9, the project rebuilts as desired. It's only when I add it to the project without making any changes).
If you want to test this yourself. Start an empty project with a source file with a certain output and press F9 to build and run. Then remove that source file, add another one with a different output and press F9 to build and run. Does it rebuild the project?
oBFusCATed:
Ok, bug confirmed...
Not sure what we can do about it.
Morten any idea? Probably it happens because we're using only timestamps detect changes to the sources.
MortenMacFly:
--- Quote from: oBFusCATed on December 09, 2015, 07:43:00 pm ---Morten any idea? Probably it happens because we're using only timestamps detect changes to the sources.
--- End quote ---
Well it looks like that but I wonder why it would have worked like that earlier then...
Actually we check the timestamp of the object file (which should be named differently in the example and therefore not present) to see if we need to build.
Did you play with the "flat objects" option or alike?
Navigation
[0] Message Index
[#] Next page
Go to full version