User forums > Using Code::Blocks
Auto Rebuild Not Working
Dalmango:
Thanks Blue. Yes I'm not too familiar with IDE's & thanks for your advice. I played a little with Dreamweaver in the past but I'm not really too worried about the IDE atm. I've come to Codeblocks because Visual Studio is way too complicated for me at this stage. Nonetheless there is a problem here regardless of methodology.
Further to your request I changed file prefs to not compile & link & chose a new file. Set that to compile & link & the file was not changed in the output. It was still running the old file. This is the build log below.
--- Code: ----------------- Build: Debug in TheNewBostonsC++ (compiler: GNU GCC Compiler)---------------
Target is up to date.
Nothing to be done (all items are up-to-date).
-------------- Run: Debug in TheNewBostonsC++ (compiler: GNU GCC Compiler)---------------
Checking for existence: D:\Learning\Programming\C++\TheNewBostonsC++\bin\Debug\TheNewBostonsC++.exe
Set variable: PATH=.;C:\Program Files\CodeBlocks\MinGW\bin;C:\Program Files\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Common Files\Sage SBD;C:\Program Files (x86)\Common Files\Sage SData;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\bah;C:\Program Files\Intel\Intel(R) Management Engine Components\bah;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Windows\System32\OpenSSH;C:\Python37;C:\Python37\Scripts;C:\Program Files (x86)\Print Conductor;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\PowerShell\7;C:\Users\bah_c\AppData\Local\Microsoft\WindowsApps;C:\Users\bah_c\AppData\Roaming\Dashlane\6.1926.1.21432\bin\Firefox_Extension\{442718d9-475e-452a-b3e1-fb1ee16b8e9f}\components;C:\Users\bah_c\AppData\Roaming\Dashlane\6.1926.1.21432\ucrt;C:\Users\bah_c\AppData\Roaming\Dashlane\6.1926.1.21432\bin\Qt;C:\Users\bah_c\AppData\Roaming\Dashlane\6.1926.1.21432\bin\Ssl;C:\msys64\usr\bin;C:\msys64\mingw64\bin
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "D:\Learning\Programming\C++\TheNewBostonsC++\bin\Debug\TheNewBostonsC++.exe" (in D:\Learning\Programming\C++\TheNewBostonsC++\.)
Process terminated with status 0 (0 minute(s), 3 second(s))
--- End code ---
I then hit rebuild, build & run & she outputs fine.
--- Code: ----------------- Build: Debug in TheNewBostonsC++ (compiler: GNU GCC Compiler)---------------
Target is up to date.
Nothing to be done (all items are up-to-date).
-------------- Run: Debug in TheNewBostonsC++ (compiler: GNU GCC Compiler)---------------
Checking for existence: D:\Learning\Programming\C++\TheNewBostonsC++\bin\Debug\TheNewBostonsC++.exe
Set variable: PATH=.;C:\Program Files\CodeBlocks\MinGW\bin;C:\Program Files\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Common Files\Sage SBD;C:\Program Files (x86)\Common Files\Sage SData;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\bah;C:\Program Files\Intel\Intel(R) Management Engine Components\bah;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Windows\System32\OpenSSH;C:\Python37;C:\Python37\Scripts;C:\Program Files (x86)\Print Conductor;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\PowerShell\7;C:\Users\bah_c\AppData\Local\Microsoft\WindowsApps;C:\Users\bah_c\AppData\Roaming\Dashlane\6.1926.1.21432\bin\Firefox_Extension\{442718d9-475e-452a-b3e1-fb1ee16b8e9f}\components;C:\Users\bah_c\AppData\Roaming\Dashlane\6.1926.1.21432\ucrt;C:\Users\bah_c\AppData\Roaming\Dashlane\6.1926.1.21432\bin\Qt;C:\Users\bah_c\AppData\Roaming\Dashlane\6.1926.1.21432\bin\Ssl;C:\msys64\usr\bin;C:\msys64\mingw64\bin
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "D:\Learning\Programming\C++\TheNewBostonsC++\bin\Debug\TheNewBostonsC++.exe" (in D:\Learning\Programming\C++\TheNewBostonsC++\.)
Process terminated with status -1073741510 (0 minute(s), 2 second(s))
--- End code ---
BlueHazzard:
--- Quote from: Dalmango on May 04, 2020, 01:20:10 pm ---
--- Quote from: stahta01 on May 04, 2020, 12:54:37 pm ---I read this thread twice; and, I see nowhere that the Code::Blocks version is stated.
What version of C::B is having this problem?
17.12, 20.03 or ?
--- End quote ---
I see posts like this all the time in where I'm a member of many forums - "what version". Never have I seen a problem solved relating to the current version. Given that patches are very minor tweaks & the issue stated here is obviously related to a global preference setting.
Usually I never see anything more constructive from the person requesting versions. They often chime in requesting every possible piece of info being requested about the programme, then nothing whatsoever to solve the problem.
Given that this was happening to my previous version before the update; which was considerably old (ver 17 something previously) it is most certainly not to do with a version. We're obviously talking about a global setting. I'm tempted to force rebuilding on the entire project, but obviously I shouldn't have to do this.
I updated to Ver 20.03 this morning.
--- End quote ---
The range of codeblocks versions in the wild is gigantic... There are reports form codeblocks version 9 years old, and there are also nightly builds, that fixed a lot bugs from 20.03 release, , versions with the same version number, but different versions of wxWidgets. versions with the same version number, same wxWidgets version number, but different GTK version, 64bit, 32bit ecc.... it is insane, so the question is really legitimate,
The build log does not look like you are making a rebuild (Build-> rebuild) The blue arrows in the toolbar, but only a build (the yellow, or yellow green button).
As i mentioned in the previous post codeblocks checks the dates from the file modification and uses this to decide if he should rebuild the exe.
Example:
1) You modify a.cpp
2) Codeblocks checks a.cpp modification date with a.obj modification date -> a.cpp is newer so rebuild a.obj
3) Codeblocks checks a.obj modification date with a.exe modification date -> a.obj is newer so rebuild a.exe
Now lets say you switch to b.cpp and disablea.cpp
4) Codeblocks checks b.cpp modification date with b.obj modification date -> b.cpp is newer so rebuild b.obj
5) Codeblocks checks b.obj modification date with a.exe modification date -> b.obj is newer so rebuild a.exe (note: here is a.exe used because you do not switch targets or project)
Now lets switch back to a.cpp without modifications, just a build
6) Codeblocks checks a.cpp modification date with a.obj modification date -> both the same, so no rebuild
7) Codeblocks checks a.obj modification date with a.exe modification date -> a.exe is newer so no rebuild -> start a.exe (the version you build with b.cpp)
Now if you hit the rebuild button (with the blue arrows) a.obj and a.exe will get deleted and everything should work...
(bare in mind, it can get quite complicated, and i may miss something here, so do not pinpoint me here....)
BlueHazzard:
If the blue arrows also not work, thy to delete the exe by hand...
Dalmango:
Thanks, yes the permutations of versions would be intense. However given I opened the thread stating I had updated & this was seen in the old version was still seen in the new version is a good indicator the version is not the issue here. I'll eat my hat if when this gets solved it's issue related.
The project was rebuilt. As stated in my prev post the sequence used was accurate, the blue rebuild icon was used; I don't think this would be indicated in the logs I'm providing you with though, this process is not recorded in the log. These logs only show the running of the programme. These logs don't even show what files are included in the output of the file.
--- Quote from: BlueHazzard on May 04, 2020, 02:09:30 pm ---Now if you hit the rebuild button (with the blue arrows) a.obj and a.exe will get deleted and everything should work...
(bare in mind, it can get quite complicated, and i may miss something here, so do not pinpoint me here....)
--- End quote ---
Thanks, I imagine there would be time & size checks to see if the files were modified, instead of running complete rebuiilds unnecssarily. Yes rebuilding is resolving the issue, clearly the issue is that Codeblocks is not writing the paths to the file which controls which files should be compiled & linked in the Codeblocks environment. It really isn't that complicated.
BlueHazzard:
Ok, i think i miss something here... I have reread the whole thread..
--- Quote ---EDIT2 - Noticed in virtual folders when selecting rename the automatically generated filename text (to rename) is ending with a \ character. I wonder if there's a bug that's adding these after the file has been created/ renamed.
If you try to save the virtual folder again then it warns you that you can't have a backslash in the filename; this is clearly a bug.
--- End quote ---
Please make a Ticket on Source Forge for this bug, where you explain the steps to reproduce it....
Your workflow is build&run a file --> everything works
Disable the file, enable a other file --> everything works
Switch back to the first file --> No build is triggered, the old executable is run
One thing i did not understand is, did your workflow worked at one point? Are you sure you did not modified the source file every time before you made a build&run?
As i mentioned earlier codeblocks uses time stamps (and as far as i know ONLY time stamps) of the object files to build the exe file.
If your exe is newer then the object file, the object file newer then the source file codeblocks can not detect that he has to rebuild the exe...
Modifying what files to compile and link via the file properties dialog is not supposed to trigger a build, because codeblocks does not know what it should rebuild (all, or only a couple files? What files?). In this case the user is supposed to trigger the rebuild manually. Codeblocks does not make any dependency checks for source files (ok, i think it makes header inspection, but that is not that difficult), so it can not detect what it should rebuild and what not...
If you enable/disable one file codeblocks should probably rebuild the whole project....
I am not sure if this is a bug or user error...
@Other devs what do you think?
Easy solution:
After modifying the build options, add a space and delete it again, save the file and hit build.... This should retrigger a build, because the source file has than a newer timestamp than the object file
[EDIT:] I think we modified the save behavior of codeblocks, so if you make no changes to the source file you can not save it. I think in old versions this was allowed... So you probably saved an unmodified file and this triggered the build process....
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version