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

For some reason my code is hitting a compile error? All the .H files are included as necceasry, am I missing something important?

1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommePickup::ReceiveActorBeginOverlap(class AActor )" (?ReceiveActorBeginOverlap@ATheSommePickup@@UEAAXPEAVAActor@@@Z) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl ATheSommePickup::CanBePickedUp(class ASommeCharacter )const " (?CanBePickedUp@ATheSommePickup@@UEBA_NPEAVASommeCharacter@@@Z) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommePickup::BeginPlay(void)" (?BeginPlay@ATheSommePickup@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl ATheSommePickup::GivePickupTo(class ATheSommeCharacter )" (?GivePickupTo@ATheSommePickup@@MEAAXPEAVATheSommeCharacter@@@Z) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::ServerStopsFire_Implementation(void)" (?ServerStopsFire_Implementation@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::ServerStopReload_Implementation(void)" (?ServerStopReload_Implementation@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::ServerStartsFire_Implementation(void)" (?ServerStartsFire_Implementation@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::ServerStartReload_Implementation(void)" (?ServerStartReload_Implementation@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::ServerHandleFiring_Implementation(void)" (?ServerHandleFiring_Implementation@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::ClientStartReload_Implementation(void)" (?ClientStartReload_Implementation@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl ATheSommeWeapon::GetReplicationList(unsigned char ,struct FPropertyRetirement ,int ,class UPackageMap ,class UActorChannel ,struct FReplicationFlags)" (?GetReplicationList@ATheSommeWeapon@@UEAAPEAHPEAEPEAUFPropertyRetirement@@PEAHPEAVUPackageMap@@PEAVUActorChannel@@UFReplicationFlags@@@Z) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::Destroyed(void)" (?Destroyed@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::StartFire(void)" (?StartFire@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::StopFire(void)" (?StopFire@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::StartReload(bool)" (?StartReload@ATheSommeWeapon@@UEAAX_N@Z) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::StopReload(void)" (?StopReload@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ATheSommeWeapon::ReloadWeapon(void)" (?ReloadWeapon@ATheSommeWeapon@@UEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2019: unresolved external symbol "protected: void __cdecl ATheSommeWeapon::OnRep_MyPawn(void)" (?OnRep_MyPawn@ATheSommeWeapon@@IEAAXXZ) referenced in function "public: void __cdecl ATheSommeWeapon::execOnRep_MyPawn(struct FFrame &,void const)" (?execOnRep_MyPawn@ATheSommeWeapon@@QEAAXAEAUFFrame@@QEAX@Z) 1>Module.TheSomme.cpp.obj : error LNK2019: unresolved external symbol "protected: void __cdecl ATheSommeWeapon::OnRep_BurstCounter(void)" (?OnRep_BurstCounter@ATheSommeWeapon@@IEAAXXZ) referenced in function "public: void __cdecl ATheSommeWeapon::execOnRep_BurstCounter(struct FFrame &,void const)" (?execOnRep_BurstCounter@ATheSommeWeapon@@QEAAXAEAUFFrame@@QEAX@Z) 1>Module.TheSomme.cpp.obj : error LNK2019: unresolved external symbol "protected: void __cdecl ATheSommeWeapon::OnRep_Reload(void)" (?OnRep_Reload@ATheSommeWeapon@@IEAAXXZ) referenced in function "public: void __cdecl ATheSommeWeapon::execOnRep_Reload(struct FFrame &,void const)" (?execOnRep_Reload@ATheSommeWeapon@@QEAAXAEAUFFrame@@QEAX@Z) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl ATheSommeWeapon::OnBurstStarted(void)" (?OnBurstStarted@ATheSommeWeapon@@MEAAXXZ) 1>Module.TheSomme.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl ATheSommeWeapon::OnBurstFinished(void)" (?OnBurstFinished@ATheSommeWeapon@@MEAAXXZ) 1>E:\TheSommeUE4\TheSomme\Binaries\Win64\RocketEditor-TheSomme.dll : fatal error LNK1120: 22 unresolved externals

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 02:37 AM in C++ Programming

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

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

1 answer: sort voted first

This is an error on your end.

Did you include the function in your .h file?

please show your .h file

did you include the function in your .cpp file?

please show your .cpp file

ATheSommePickup::

Did you include the

 ATheSommePickup::

in your .cpp function definition?

Rama

more ▼

answered Mar 11 '14 at 02:37 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:37 AM

Not all of these functions have been utilized in the .cpp file yet, but yeah the Header is Included :)

So, every function I declare in the Header file must be used in the .cpp file too?

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:37 AM

Virtual

if it is virtual yes, you either include a empty definition {}

or you make it pure virtual with = 0; in the .h file

but that could get confusing if you are just delaying implementation rather than deferring to subclass

so I'd recommend an empty definition if it is planned to be implemented in that class later

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:37 AM

PS: if this answers your question please check mark my answer

avatar image jasonmeverett Jun 11 '17 at 06:20 PM

This is the answer I came here to find. Thanks.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 02:37 AM

Thanks rama :)

avatar image Ambak Nov 09 '17 at 10:01 AM

Hi, I was looking for an answer to a similar error that I got when I created a BTTaskNode (C++). It starts to give all these errors after you do a add new class from the content browser. Maybe like many other classes the editor can generate the boiler plate for this class as well, just a thought, I know why the error and have solved it looking at this post, so thanks for that..

avatar image Andrew2015 Nov 09 '17 at 10:16 AM

Hi! Ambak. Please check file .Build.cs

add to PublicDependencyModuleNames AIModule

PublicDependencyModuleNames.AddRange(new string[] { ..., "AIModule" });

see more https://docs.unrealengine.com/latest/INT/API/Runtime/AIModule/BehaviorTree/UBTTaskNode/#references

Hope this helps!

avatar image Ambak Nov 09 '17 at 12:15 PM

Hi, Thanks Andy,

yea the AIModule was already in there, I'm pretty sure the problem was the Interface IGameplayTaskOwnerInterface that the class UBTNode implements which is in turn is extended by BTTaskNode. The guilty method: virtual void OnGameplayTaskActivated(UGameplayTask& Task)

Not a C++ expert, and was expecting to see the override keyword on the method to indicate that, in Java for example you have to implement all interface methods or declare your class abstract (sorry not drawing any language comparisons). didn't strike me that virtual would do the same thing, and probably the other functions in the interface have already been given implementation in the inheritance chain..

But I think this is what Rama suggested in response to the post above. I just gave it an empty implementation and boom, the code compiled..

(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