Can't call static function from UNavigationSystemV1

Hello.
I try to call a function FindPathToActorSynchronously() from UNavigationSystemV1 but have an error LNK2019.

Steps:

  1. #include “NavigationSystem.h”

  2. Use function UNavigationSystemV1::FindPathToActorSynchronously(args…);

Result: error LNK2019 ёё√ыър эр эхЁрчЁх°хээ√щ тэх°эшщ ёшьтюы “__declspec(dllimport) public: static class UNavigationPath * __cdecl UNavigationSystemV1::FindPathToActorSynchronously(class UObject *,struct FVector const &,class AActor *,float,class AActor *,class TSubclassOf)” (_imp?FindPathToActorSynchronously@UNavigationSystemV1@@SAPEAVUNavigationPath@@PEAVUObject@@AEBUFVector@@PEAVAActor@@M2V?$TSubclassOf@VUNavigationQueryFilter@@@@@Z) т ЇєэъЎшш “protected: virtual void __cdecl ABasePlayerCharacter::BeginPlay(void)” (?BeginPlay@ABasePlayerCharacter@@MEAAXXZ)

FindPathToActorSynchronously is a static function. I am new in C++
so maybe i missed something obvious? Thanks for any help.

Usually when I hit these linker errors it’s a case of not including the module in the Build.cs file. In your case that’d be the NavigationSystem module.

Open your *.Build.cs file and add NavigationSystem to the PublicDependencyModules like this:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "NavigationSystem" });
1 Like

You saved me a lot of time)) Thanks a lot!