4.12.5 and VS2015 Update 3 unresolved external symbol

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.

There are some unresolved known issues with VS2015 Update 3. Try to use a less recent update.

Hey GCRev-

The class that you are using as your parent class (SceneCaptureComponent2D.h) is marked as MinimalAPI which limits the class exposure in the engine. You can find more information on the use of MinimalAPI in the documentation (https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Reference/Classes/Specifiers/MinimalAPI/). If you are using a source version of the engine, you can open the header file and remove MinimalAPI to allow for child classes of SceneCaptureComponent2D.

Cheers

So I have the engine source and here is the header of the USceneCaptureComponent2D:

UCLASS(hidecategories=(Collision, Object, Physics, SceneComponent), ClassGroup=Rendering, MinimalAPI, editinlinenew, meta=(BlueprintSpawnableComponent))
class USceneCaptureComponent2D : public USceneCaptureComponent

There is the “MinimalAPI” there - forgive me for misinterpreting your instruction, but removing this from the macro does not seem to do anything in particular, and I get the same build errors as before when re-building the engine source.

How do I actually remove the MinimalAPI, and which headerfile are you talking about?

Thanks

While modifying and rebuilding the engine would work, it can be annoying. I’d recommend first seeing if there’s another way, like putting your logic in a custom actor class that contains a standard SceneCaptureComponent.

Another solution that was mentioned to me is to check the ProjectName.h file. Usually this file has a line #include "EngineMinimal.h". Changing this to #include "Engine.h" you should be able to avoid the error you’re receiving.