What are the requirements for C++ programming in Unreal?

It may sound a dumb question, but I’m having a lot of issues just trying to start a project.

I first installed Visual Studio 2017 with the C++ Game Development package, and I couldn’t even start a project because some DLL (UE4Editor-MyProject.dll) was missing. It told me to open it with Visual Studio to compile it, which did absolutely nothing. I tried to do it by right-clicking the UProject → Generate VS project file, which also didn’t work. I couldn’t even open a project.

Then I tried installing VS 2015 with the C++ tools. I got the same error about the DLL. But this time, I could open it with VS and compile it, and this way I could open the UProject, but when I do so, I get a huge amount of Errors through the log about some DLL files (again), and when I create a C++ Class, some lines like the #include “UObject_Test.generated.h” , or UCLASS() I get errors regarding a file that couldn’t be opened or a declaration that has no type specifier. And yes, I HAVE installed Windows 8.1 SDK.

So, If anyone could tell me everything that I have to install in order to make an Unreal project with C++, I’d really apprecciate it! Thanks a lot beforehand!

Hi xLectro

A few hints that may help:

VS2017 works a little better than 2015 but you need to install it with VS 2015 Build Tools (it’s in the installation options). UE4 v4.17 is still using these tools for building the editor and the project.

If it’s a C++ project with files that were never compiled, you’ll get errors when trying to open the .uproject file. Open the .sln in VS and generate the project. You can also run (with debugging) it from VS, it’s usually more useful for debugging.

Don’t bother too much with Intellisense errors ( underlined with a zigzag in VS editor ). Intellisense is the database that help you when typing, it’s not the compiler. Most of the errors will disappear when you’ll generate the project. If it doesn’t, close the file with errors and reopen it. Intellisense get lost when there’s too many new #include but most of the time the close-reopen trick will do the work.

xxxx.generated.h files are generated when you first compile your project. They sometimes (rarely with newer UE4 versions) get corrupted, If so, delete them. The next generation will recreate them.

Right-clicking UProject to generate VS project files is the thing to do when you copy a project from a computer to an other (or recover one from source control).

And be sure that your game is the “starting project” in VS, not UE4.

I hope it will help, If it’s still not working, show me the errors list.

A few more things:

When generating the project, it is perfecly normal to have a lot of warning messages about DLLs like this one:

‘UE4Editor.exe’ (Win32) : Loaded ‘C:\Windows\System32\DataExchange.dll’. Impossible to find or open the PDB file.

The UE4 DLLs and the WIndows SDK DLLs don’t always have a PDB (debugging file) associated to them. Some of them have one but you’ll need to give the path in your project. Anyway, you won’t debug these DLLs so forget about the warnings.

Errors to “UObject_Test.generated.h” , or UCLASS() or UFUNCTION or UPROPERTY are Intellisense errors. They should disappear with close-reopen.

If the Editor start correctly then you have no real C++ error and you can go on. Using the compile button in the Editor is the fastest way to compile new code. The log will give you warning and/or errors but if Unreal Editor show you the green C++ Compile Completed then you have no C++ error.

If you close your project while having C++ errors, you won’t be able to open it in the editor. You’ll need to open it in VS, and make corrections before running the editor.

OK, so most of the things work actually fine as you described. I tried doing some test following the official Unreal C++ tutorials, so I coded an actor which goes up and down, as simple as that. When I build the solution in VS, it builds without problem, but when I go to UE and click compile, it fails and gives me this: “ERROR: Multiple configurations specified on command line (first Test, then Development)”. When I click play, the class I programmed just doesn’t do anything.
Thank you for your help and hope you can keep giving me a hand on this issue!

Hi xLectro,
Did you name your project Test ?

I had a similar problem with a small project I did to test a few things and naturally I’d name it Test. The generation gave me exactly the same error. It seems that the word Test is a reserved word on the gegneration line son you can’t name your project Test .

Oh come on, so after all this headache it was all because I named my project “Test”. That was really unexpected.
Well, thank you very much! That helped me a lot!