I can't compile C++ code in editor

Look at the last line of the VS log, It’s a permissions issue, one of your binary files is getting locked. Make sure every instance of unreal is shut down, restart the machine if you have to.

Happens to me usually when I have both the editor and VS open, the two don’t always communicate correctly and sometimes the editor doesn’t release all of the files.

Also double check your build setting at the top is set to Development Editor:

110045-buildsetting.png



Finally, if all else is still failing, remove/rename the folders I have highlighted here:

110046-deletablefolders.png

(I personally delete the binaries, intermediate, and saved folders before every backup to reduce bloat.)

then right click on the uproject file and select Generate Solution

Then open up the solution in visual studio, right click on the project (not the UE4), and tell it to build.

1 Like