Sounds like the issue is that the files aren't being seen as changed on disk. If you save the file first does it work?
First question is if you actually have the solution open and not just loaded into VS (there is a difference). Solution Explorer
should show the solution node with the C++ project under it. There should be no mention of a "folder view".
Is the file you're editing actually in the project? In the editor tab for the file you're modifying right click and select the option to open in file explorer. Is that the file the same file that is in the project under Solution Explorer?
In Solution Explorer there is an option to show all files, not just those in the project. Next to the filename you should see C++
or similar. If you see a red icon then that file isn't part of the project.
Is the project either the startup project or referenced by the startup project? If not then by default VS won't rebuild projects it doesn't need.
If none of that helps then turn on detailed logging under Tools\Options -> Projects and Solutions -> Build and Run
. Set the build output to Detailed and build the solution so we can see the build logs.