I followed the C++ Programming Quick Start Guide verbatim, but it seems to be missing something as the code compilation and execution don’t work as described in the documentation. The steps to reproduce what I observed are as follows:
- Launch Unreal Engine 4.7.1
- Create a New C++, Blank Code Project (this launches Visual Studio Express 2013 and the Unreal Editor)
- From the editor, as per the documentation, add code to project, Actor class.
- Make the appropriate code modifications in Visual Studio
- Right click on your project in Visual Studio and build which results in the following output:
1>------ Build started: Project: MyProject, Configuration: Development_Editor x64 ------
1> Parsing headers for MyProjectEditor
1> Reflection code generated for MyProjectEditor
1> Deleting old hot reload file: “D:\Users\D\Documents\Unreal Projects\MyProject\Binaries\Win64\UE4Editor-MyProject-3144.dll”.
1> Unable to delete old hot reload file: “D:\Users\D\Documents\Unreal Projects\MyProject\Binaries\Win64\UE4Editor-MyProject-3144.dll”. Error: D:\Users\D\Documents\Unreal Projects\MyProject\Binaries\Win64\UE4Editor-MyProject-3144.dll
1> Deleting old hot reload file: “D:\Users\D\Documents\Unreal Projects\MyProject\Binaries\Win64\UE4Editor-MyProject-3144.pdb”.
1> Performing 3 actions (4 in parallel)
1> MyProject.generated.cpp
1> MyActor.cpp
1> [3/3] Link UE4Editor-MyProject.dll
1>LINK : fatal error LNK1104: cannot open file ‘D:\Users\D\Documents\Unreal Projects\MyProject\Binaries\Win64\UE4Editor-MyProject.dll’
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: D:\Users\D\Documents\Unreal Projects\MyProject\Binaries\Win64\UE4Editor-MyProject.pdb
1> Cumulative action seconds (8 processors): 0.00 building projects, 0.39 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.10 linking, 0.00 other
1> UBT execution time: 8.86 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ““K:\Program Files\Unreal Engine\4.7\Engine\Build\BatchFiles\Build.bat” MyProjectEditor Win64
Development “D:\Users\D\Documents\Unreal Projects\MyProject\MyProject.uproject” -rocket” exited with code -1.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
So it seems a file is in use. I return to the editor and use the “Compile” button alternative as noted on page 3. This reports a successful compile. I continue with the steps to add the actor, etc. Click play and… nothing. The cone does not move. However, if you instead “Launch”, the cone does animate as intended.
If visual studio is closed in the background and reopened from the Unreal Editor, the code can now be successfully built in Visual Studio, but the changes still will not take effect using the play button. Only by exiting the editor and reloading the project does the hot loading appear to function as described in the tutorial.
Derek.