First of all, I’ve been browsing the other questions related to the QuickStart guide for a while and I haven’t found an answer to my question.
So I’ve been trying to make the QuickStart guide work from this page:
https://docs.unrealengine.com/latest/INT/Programming/QuickStart/3/index.html
I’ve done all the previous steps exactly the same way (same project name, class names…) and building the “empty” project with no classes worked fine as I was able to open it up in the editor.
But once I come to step 3 where I need to copy the sample code and build it I get errors:
1>------ Build started: Project: QuickStart, Configuration: Development_Editor x64 ------
1> Compiling game modules for hot reload
1> Parsing headers for QuickStartEditor
1> Reflection code generated for QuickStartEditor
1> Performing 2 actions (4 in parallel)
1> FloatingActor.cpp
1>C:\Users\Void\Documents\Unreal Projects\QuickStart\Source\QuickStart\FloatingActor.cpp(8): error C2512: 'AActor' : no appropriate default constructor available
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Users\Void\Documents\Unreal Projects\QuickStart\Binaries\Win64\UE4Editor-QuickStart-3982.dll
1> Cumulative action seconds (8 processors): 0.00 building projects, 0.28 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.00 linking, 0.00 other
1> UBT execution time: 12.96 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command ""C:\Unreal Engine-4.6.1\Engine\Build\BatchFiles\Build.bat" QuickStartEditor Win64 Development "C:\Users\Void\Documents\Unreal Projects\QuickStart\QuickStart.uproject"" exited with code -1.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
So yes the error is appearing here in the cpp file:
AFloatingActor::AFloatingActor()
It says that the class AActor has no default constructor. I might be a bit rusty in C++ but I don’t see why I’m getting this error. I mean AFloatingActor inherits from AActor and AActor has a default constructor unless I’m blind/crazy. Any help would be really appreciated.
PS: I’m using Unreal Engine 4.6.1
EDIT: Ok so I’ve looked into the source code and I can’t see the default constructor for AActor anywhere inside Actor.cpp/Actor.h. Previously I said that AActor has a default constructor that is because I’ve been looking at the online doc that says it here:
But inside the source code the declaration is missing. Now unless I’m completely wrong (which is possible since I’ve been out of touch with C++ for some time now), since AActor has already a custom constructor: AActor(const FObjectInitializer& ObjectInitializer); this means that if one wants to use the default constructor like AActor(); one has to explicitly declare it. This is really making me crazy… >_>