x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.12
Tags:
more ▼

asked Jul 10 '16 at 03:30 PM in C++ Programming

avatar image

GCRev
31 1 4 6

avatar image NymKappa Jul 11 '16 at 08:14 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

Doug Wilson

more ▼

answered Jul 11 '16 at 01:08 PM

avatar image GCRev Jul 14 '16 at 03:10 AM

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

avatar image Digi Labs Dan Jul 14 '16 at 06:03 AM

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.

avatar image Doug E ♦♦ STAFF Jul 14 '16 at 12:20 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question