I am currently working on a game engine in c++. As I have progressed further into the project, I have noticed that the resulting executable often does not reflect the latest code changes. But completely cleaning the solution and rebuilding it, fixes the problem. Unfortunately a complete rebuild is not a viable option for a larger code base anymore.
I have already checked different solutions on stackoverflow:
- I have checked that my "Build and Run" setting is set to "Always build"
- The Configuration Manager is also set to "Build"
Additional information:
- It is an
OpenGL
project withGLFW
andglad
in c++ - I use Visual Studio Community 2017 Version 15.2
This is a really annoying issue that causes a lot of productivity loss, since I have to completely rebuild the entire solution every time I want to see a change. I would be grateful for any input. Please ask if more information is required.
I don't know if this is of any relevance, but this is what I get when making a small change to TestScene.cpp and rerunning the code:
UPDATE
Here is an in depth explanation of the issue:
- I have a class that allows to rotate an object TransformerScript.cpp
- I have set the rotation speed to 1.
- The object rotates as expected.
- Now I change the speed float value from 1 to 0.
- I press run (Local Windows Debugger)
- This is the output log:
1>------ Build started: Project: Star-Engine, Configuration: Debug x64 ------
1>TransformerScript.cpp
1>c:\users\haeri\documents\github\space-engine\star-engine\src\header\matrix4f.h(44): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
1>c:\users\haeri\documents\github\space-engine\star-engine\src\header\matrix4f.h(44): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
1>c:\users\haeri\documents\github\space-engine\star-engine\src\header\matrix4f.h(45): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
1>c:\users\haeri\documents\github\space-engine\star-engine\src\source\transformerscript.cpp(13): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
1>Compiling...
1>Generating Code...
1>Skipping... (no relevant changes detected)
1>TestScene.cpp
1>Star-Engine.vcxproj -> C:\Users\haeri\Documents\github\Space-Engine\x64\Debug\Star-Engine.exe
c:\users\haeri\documents\github\space-engine\star-engine\src\source\glad.c(51): warning C6308: 'realloc' might return null pointer: assigning null pointer to 'exts_i', which is passed as an argument to 'realloc', will cause the original memory block to be leaked.
c:\users\haeri\documents\github\space-engine\star-engine\include\stb\stb_image.h(3667): warning C6001: Using uninitialized memory 'coutput'.
1>Star-Engine.vcxproj -> C:\Users\haeri\Documents\github\Space-Engine\x64\Debug\Star-Engine.pdb (Partial PDB)
1>Done building project "Star-Engine.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
- The compiled executable starts
- The result is the same figure rotating at the same speed.
- Expected behavior: No rotation, since the float was set to 0.
- I am forced to "clean solution" and "Rebuild solution"
- This takes about 1 to 2 minutes on my laptop
- VS finishes rebuilding the new solution
- I press run (Local Windows Debugger)
- The Object is not moving. (This is as expected)
Alternative approach
- Set break point at the position of the speed float value
- I press run (Local Windows Debugger)
- Sometimes (90% of the cases) an error Prompt pops up. Other times (10% of the cases) everything works as expected
- I press ok
- The compiled executable starts
- The result is the same figure rotating at the same speed.
- Expected behavior: No rotation, since the float was set to 0.
- The break point is not triggered!