I am getting compiler errors deriving from the generated header and the macros included in a new empty class in a new empty project. This is a bit discouraging.
My current version of visual studio is VS2015 Update 3.
I have also uninstalled and re-installed Unreal 4.12.5 just to be sure there was nothing that I missed.
#pragma once
#include "Components/SceneCaptureComponent2D.h"
#include "PortalCaptureComponent2D.generated.h"
/**
*
*/
UCLASS()
class PID_API UPortalCaptureComponent2D : public USceneCaptureComponent2D
{
GENERATED_BODY()
// the standard new class
};
The compiler error, from the output log:
CompilerResultsLog: Info Creating library F:\Documents(E)\Unreal Projects\PID\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-PID-6334.lib and object F:\Documents(E)\Unreal Projects\PID\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-PID-6334.exp
CompilerResultsLog:Error: Error PortalCaptureComponent2D.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent::PostLoad(void)" (?PostLoad@USceneCaptureComponent@@UEAAXXZ)
CompilerResultsLog:Error: Error PID.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent::PostLoad(void)" (?PostLoad@USceneCaptureComponent@@UEAAXXZ)
CompilerResultsLog:Error: Error PortalCaptureComponent2D.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::OnRegister(void)" (?OnRegister@USceneCaptureComponent2D@@UEAAXXZ)
CompilerResultsLog:Error: Error PID.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::OnRegister(void)" (?OnRegister@USceneCaptureComponent2D@@UEAAXXZ)
CompilerResultsLog:Error: Error PortalCaptureComponent2D.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::SendRenderTransform_Concurrent(void)" (?SendRenderTransform_Concurrent@USceneCaptureComponent2D@@UEAAXXZ)
CompilerResultsLog:Error: Error PID.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::SendRenderTransform_Concurrent(void)" (?SendRenderTransform_Concurrent@USceneCaptureComponent2D@@UEAAXXZ)
CompilerResultsLog:Error: Error PortalCaptureComponent2D.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::TickComponent(float,enum ELevelTick,struct FActorComponentTickFunction *)" (?TickComponent@USceneCaptureComponent2D@@UEAAXMW4ELevelTick@@PEAUFActorComponentTickFunction@@@Z)
CompilerResultsLog:Error: Error PID.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::TickComponent(float,enum ELevelTick,struct FActorComponentTickFunction *)" (?TickComponent@USceneCaptureComponent2D@@UEAAXMW4ELevelTick@@PEAUFActorComponentTickFunction@@@Z)
CompilerResultsLog:Error: Error PortalCaptureComponent2D.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::PostEditChangeProperty(struct FPropertyChangedEvent &)" (?PostEditChangeProperty@USceneCaptureComponent2D@@UEAAXAEAUFPropertyChangedEvent@@@Z)
CompilerResultsLog:Error: Error PID.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::PostEditChangeProperty(struct FPropertyChangedEvent &)" (?PostEditChangeProperty@USceneCaptureComponent2D@@UEAAXAEAUFPropertyChangedEvent@@@Z)
CompilerResultsLog:Error: Error PortalCaptureComponent2D.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::Serialize(class FArchive &)" (?Serialize@USceneCaptureComponent2D@@UEAAXAEAVFArchive@@@Z)
CompilerResultsLog:Error: Error PID.generated.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl USceneCaptureComponent2D::Serialize(class FArchive &)" (?Serialize@USceneCaptureComponent2D@@UEAAXAEAVFArchive@@@Z)
CompilerResultsLog:Error: Error PID.generated.cpp.obj : error LNK2019: unresolved external symbol "public: static void __cdecl USceneCaptureComponent::AddReferencedObjects(class UObject *,class FReferenceCollector &)" (?AddReferencedObjects@USceneCaptureComponent@@SAXPEAVUObject@@AEAVFReferenceCollector@@@Z) referenced in function "private: static class UCla
ss * __cdecl UPortalCaptureComponent2D::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@UPortalCaptureComponent2D@@CAPEAVUClass@@PEB_W@Z)
CompilerResultsLog:Error: Error F:\Documents(E)\Unreal Projects\PID\Binaries\Win64\UE4Editor-PID-6334.dll : fatal error LNK1120: 7 unresolved externals
CompilerResultsLog: Info ERROR: UBT ERROR: Failed to produce item: F:\Documents(E)\Unreal Projects\PID\Binaries\Win64\UE4Editor-PID-6334.dll
I checked a few other posts regarding this issue -
One post said to go remove some error pragmas which failed to solve this issue for me.
Another recommended updating everything to the most recent versions - this may be the problem, but it’s difficult to tell. This error log really does make it seem like the problem is within the generated unreal code itself.