I can't compile C++ code in editor

Hello,
I am new to ue4 and this is my first try to create C++ project.

I created project and created a C++ code in editor. However code can’t be compiled in editor.

Here is the log output:
After that I tried to compile in VS. I closed the editor and open .sln file. I’ve tried to build project but it also gave some errors.

What should I do?

do you use external library/headers ? or is it a demo from ue3 ?

Hey umurcg-

What version of Visual Studio are you using? Additionally how did you add the MyCharacter and MyClass classes to the project? Was this done through the editor using the “New C++ Class” option or was it done directly inside Visual Studio? If you added them from VS, were the classes created as a C class or a C++ class?

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

This is looking ALOT like an issue I’ve been having lately while trying to use multiple gameplay modules within a project. I’ll give this a shot.