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"

Unresolved external symbol: inheriting from URadialForceComponent

This question was already posted at the forums but I'm hoping to find answers here since this looks like an engine problem.

After inheriting from URadialForceComponent and trying to compile, I ended up with several unresolved external symbol errors.

[.h]

 #pragma once
 
 #include "PhysicsEngine/RadialForceComponent.h"
 #include "SF_RadialForceComponent.generated.h"
 
 /**
  * 
  */
 UCLASS()
 class SHOOTERGAME_API USF_RadialForceComponent : public URadialForceComponent
 {
     GENERATED_BODY()
 
     
 };

[.cpp]

 #include "ShooterGame.h"
 #include "SF_RadialForceComponent.h"

Compiling this gives me a set of errors:

 1>Module.ShooterGame.1_of_3.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::FireImpulse(void)" (?FireImpulse@URadialForceComponent@@UEAAXXZ)
 1>ShooterGame.generated.1.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::FireImpulse(void)" (?FireImpulse@URadialForceComponent@@UEAAXXZ)
 1>ShooterGame.generated.2.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::FireImpulse(void)" (?FireImpulse@URadialForceComponent@@UEAAXXZ)
 1>Module.ShooterGame.1_of_3.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::AddObjectTypeToAffect(class TEnumAsByte<enum EObjectTypeQuery>)" (?AddObjectTypeToAffect@URadialForceComponent@@UEAAXV?$TEnumAsByte@W4EObjectTypeQuery@@@@@Z)
 1>ShooterGame.generated.1.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::AddObjectTypeToAffect(class TEnumAsByte<enum EObjectTypeQuery>)" (?AddObjectTypeToAffect@URadialForceComponent@@UEAAXV?$TEnumAsByte@W4EObjectTypeQuery@@@@@Z)
 1>ShooterGame.generated.2.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::AddObjectTypeToAffect(class TEnumAsByte<enum EObjectTypeQuery>)" (?AddObjectTypeToAffect@URadialForceComponent@@UEAAXV?$TEnumAsByte@W4EObjectTypeQuery@@@@@Z)
 1>Module.ShooterGame.1_of_3.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::RemoveObjectTypeToAffect(class TEnumAsByte<enum EObjectTypeQuery>)" (?RemoveObjectTypeToAffect@URadialForceComponent@@UEAAXV?$TEnumAsByte@W4EObjectTypeQuery@@@@@Z)
 1>ShooterGame.generated.1.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::RemoveObjectTypeToAffect(class TEnumAsByte<enum EObjectTypeQuery>)" (?RemoveObjectTypeToAffect@URadialForceComponent@@UEAAXV?$TEnumAsByte@W4EObjectTypeQuery@@@@@Z)
 1>ShooterGame.generated.2.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl URadialForceComponent::RemoveObjectTypeToAffect(class TEnumAsByte<enum EObjectTypeQuery>)" (?RemoveObjectTypeToAffect@URadialForceComponent@@UEAAXV?$TEnumAsByte@W4EObjectTypeQuery@@@@@Z)
 1>Module.ShooterGame.1_of_3.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::TickComponent(float,enum ELevelTick,struct FActorComponentTickFunction *)" (?TickComponent@URadialForceComponent@@MEAAXMW4ELevelTick@@PEAUFActorComponentTickFunction@@@Z)
 1>ShooterGame.generated.1.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::TickComponent(float,enum ELevelTick,struct FActorComponentTickFunction *)" (?TickComponent@URadialForceComponent@@MEAAXMW4ELevelTick@@PEAUFActorComponentTickFunction@@@Z)
 1>ShooterGame.generated.2.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::TickComponent(float,enum ELevelTick,struct FActorComponentTickFunction *)" (?TickComponent@URadialForceComponent@@MEAAXMW4ELevelTick@@PEAUFActorComponentTickFunction@@@Z)
 1>Module.ShooterGame.1_of_3.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::BeginPlay(void)" (?BeginPlay@URadialForceComponent@@MEAAXXZ)
 1>ShooterGame.generated.1.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::BeginPlay(void)" (?BeginPlay@URadialForceComponent@@MEAAXXZ)
 1>ShooterGame.generated.2.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::BeginPlay(void)" (?BeginPlay@URadialForceComponent@@MEAAXXZ)
 1>Module.ShooterGame.1_of_3.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::PostLoad(void)" (?PostLoad@URadialForceComponent@@MEAAXXZ)
 1>ShooterGame.generated.1.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::PostLoad(void)" (?PostLoad@URadialForceComponent@@MEAAXXZ)
 1>ShooterGame.generated.2.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::PostLoad(void)" (?PostLoad@URadialForceComponent@@MEAAXXZ)
 1>Module.ShooterGame.1_of_3.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::PostEditChangeProperty(struct FPropertyChangedEvent &)" (?PostEditChangeProperty@URadialForceComponent@@MEAAXAEAUFPropertyChangedEvent@@@Z)
 1>ShooterGame.generated.1.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::PostEditChangeProperty(struct FPropertyChangedEvent &)" (?PostEditChangeProperty@URadialForceComponent@@MEAAXAEAUFPropertyChangedEvent@@@Z)
 1>ShooterGame.generated.2.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl URadialForceComponent::PostEditChangeProperty(struct FPropertyChangedEvent &)" (?PostEditChangeProperty@URadialForceComponent@@MEAAXAEAUFPropertyChangedEvent@@@Z)

I'm using UE4 version 4.15.

After doing some research, I found a 2 year-old Answerhub thread with exactly the same error, but with no clear solutions.

Any thoughts? Thanks.

Product Version: UE 4.15
Tags:
more ▼

asked Mar 07 '17 at 01:32 PM in C++ Programming

avatar image

MatheusRC
6 2 7 8

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

1 answer: sort voted first

Hi ,

The reason that you are getting these errors is because URadialForceComponent is missing ENGINE_API in its declaration. Simply add that tag and remove the MinimalAPI meta data tag to get it to compile successfully.

EDIT: I created a PR that addresses this issue #3346.

Cheers,

more ▼

answered Mar 07 '17 at 01:58 PM

avatar image

project.gheist
1.7k 22 10 49

avatar image MatheusRC Mar 07 '17 at 03:35 PM

Thanks.

Strangely, it did not compiled succesfully, giving me these errors:

 1>D:\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\PhysicsEngine/RadialForceComponent.h(18): error C2487: 'GetPrivateStaticClass': member of dll interface class may not be declared with dll interface
 1>D:\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\PhysicsEngine/RadialForceComponent.h(18): error C2487: 'URadialForceComponent::{ctor}': member of dll interface class may not be declared with dll interface

Did you manage to compile it?

avatar image project.gheist Mar 07 '17 at 08:03 PM

I did a full recompile on the engine, and it completed without issues :S .

avatar image MatheusRC Mar 08 '17 at 03:43 PM

Created a clean project to test this.

At first I compiled the whole solution, and it was sucessfull:

 ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

Then, I did the changings at RadialForceComponent.h as suggested, and after compilling it gave me this:

 2>D:\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\PhysicsEngine/RadialForceComponent.h(18): error C2487: 'GetPrivateStaticClass': member of dll interface class may not be declared with dll interface
 2>D:\Epic Games\UE_4.15\Engine\Source\Runtime\Engine\Classes\PhysicsEngine/RadialForceComponent.h(18): error C2487: 'URadialForceComponent::{ctor}': member of dll interface class may not be declared with dll interface
 2>ERROR : UBT error : Failed to produce item: D:\UnrealEngineProjects\RadCompBlank\Binaries\Win64\UE4Editor-RadCompBlank.dll
 2>  Total build time: 71,15 seconds (Local executor: 0,00 seconds)
 2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(46,5): error MSB3073: The command ""D:\Epic Games\UE_4.15\Engine\Build\BatchFiles\Rebuild.bat" RadCompBlankEditor Win64 Development "D:\UnrealEngineProjects\RadCompBlank\RadCompBlank.uproject" -waitmutex" exited with code -1.
 ========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

How did you manage to make this work? :o

(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