# Error LNK2019：无法解析的外部符号

**URL:** <https://forums.unrealengine.com/t/error-lnk2019/455903>\
**Category:** C++\
**Tags:** lnk2019, unreal-engine, UE4, CPP, question\
**Created:** [September 24, 2019, 4:44pm UTC](https://forums.unrealengine.com/t/error-lnk2019/455903 "2019-09-24T16:44:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anonymous\_c5a03f4359d9b514c2a54272b181205f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_c5a03f4359d9b514c2a54272b181205f](https://forums.unrealengine.com/u/Anonymous_c5a03f4359d9b514c2a54272b181205f)\
**Post date:** [September 24, 2019, 4:44pm UTC](https://forums.unrealengine.com/t/error-lnk2019/455903/1 "2019-09-24T16:44:07Z")

</div>

错误如下：

2\>STrackerBot.cpp.obj : 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: struct FVector \_\_cdecl ASTrackerBot::GetNextPathPoint(void)” (?GetNextPathPoint@ASTrackerBot@@IEAA?AUFVector@@anonymous_user_9674a66c) 中被引用

使用引擎版本4.23  
问题来源于使用了NavigationSystem.h 中的FindPathToActorSynchronously()函数。  
我是跟着教程做的，但是教程可能使用的4.17还是4.18版本，这个NavigationSystem.h的头文件位置不太一样，但是我自己添加包含以后发现编译无法通过。

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_376bd569](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_376bd569](https://forums.unrealengine.com/u/anonymous_user_376bd569)\
**Post date:** [February 21, 2022, 3:16pm UTC](https://forums.unrealengine.com/t/error-lnk2019/455903/2 "2022-02-21T15:16:24Z")

</div>

似乎在新版本中需要添加Navigation的模块， 可以在Build.cs文件中添加”NavigationSystem“来添加该模块，该问题在下面这个链接中可以查看到。

> [@FindPathToActorSynchronously() function not working!](https://forums.unrealengine.com/t/findpathtoactorsynchronously-function-not-working/436905/2):
>
> Hi! check NavigationSystem module added in ProjectName.Build.cs file PublicDependencyModuleNames.AddRange(new string[] { “NavigationSystem” });
