The last Windows 10 update adds optional protection to folders under Documents, so untrusted programs can't modify files inside those folders; Did you activate this option in Windows Defender?.
Copy the project folder outside of Documents (p.e. C:\CBProjects) and try to compile the copy.
If this does not work try opening a cmd console where main.cpp resides and execute
mingw32-g++.exe -Wall -fexceptions -g -c main.cpp -o main.o
Post the output of the command here.
OK, in the CMD type this in this order:
set PATH=%PATH%;c:\MinGW\bin
and then
mingw32-g++.exe -Wall -fexceptions -g -c main.cpp -o main.o
The first command will add the MinGW compiler directory to your path so cmd can find the compiler command. The second command will try to build your source without codeblocks, so we can see if something is blocking the compiler.
[Edit:] as soon as you close the cmd you will have to retype the first command.
Try
mingw32-gcc.exe -Wall -fexceptions -g -c main.cpp -o main.o