Announcement

Collapse
No announcement yet.

Simple FindPathToActorSynchronously compile error in C++ [SOLVED]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Simple FindPathToActorSynchronously compile error in C++ [SOLVED]

    How can I fix it? What possible could go wrong? UE4.23(from EPGS launcher)

    Severity Code Description Project File Line Suppression State
    Error LNK2019 unresolved external symbol "__declspec(dllimport) public: static class UNavigationPath * __cdecl UNavigationSystemV1::FindPathToActorSynchronously(class UObject *,struct FVector const &,class AActor *,float,class AActor *,class TSubclassOf<class UNavigationQueryFilter>)" (__imp_?FindPathToActorSynchronously@UNavigationSystemV1@@SAPEAVUNavigationPath@@PEAVUObject@@AEBUFVector@@PEAVAActor@@M2V?$TSubclassOf@VUNavigationQueryFilter@@@@@Z) referenced in function "protected: struct FVector __cdecl ASTrackerBot::GetNextPathPoint(void)" (?GetNextPathPoint@ASTrackerBot@@IEAA?AUFVector@@XZ) CoopGame G:\Documents\Unreal Projects\CoopGame\Intermediate\ProjectFiles\STrackerBot.cpp.obj 1
    OUTPUT:
    2> Creating library G:\Documents\Unreal Projects\CoopGame\Intermediate\Build\Win64\UE4Editor\Development\CoopGame\UE4Editor-CoopGame.suppressed.lib and object G:\Documents\Unreal Projects\CoopGame\Intermediate\Build\Win64\UE4Editor\Development\CoopGame\UE4Editor-CoopGame.suppressed.exp
    2>STrackerBot.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class UNavigationPath * __cdecl UNavigationSystemV1::FindPathToActorSynchronously(class UObject *,struct FVector const &,class AActor *,float,class AActor *,class TSubclassOf<class UNavigationQueryFilter>)" (__imp_?FindPathToActorSynchronously@UNavigationSystemV1@@SAPEAVUNavigationPath@@PEAVUObject@@AEBUFVector@@PEAVAActor@@M2V?$TSubclassOf@VUNavigationQueryFilter@@@@@Z) referenced in function "protected: struct FVector __cdecl ASTrackerBot::GetNextPathPoint(void)" (?GetNextPathPoint@ASTrackerBot@@IEAA?AUFVector@@XZ)
    2>G:\Documents\Unreal Projects\CoopGame\Binaries\Win64\UE4Editor-CoopGame.dll : fatal error LNK1120: 1 unresolved externals
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ""C:\Program Files\Epic Games\UE_4.23\Engine\Build\BatchFiles\Build.bat" CoopGameEditor Win64 Development -Project="G:\Documents\Unreal Projects\CoopGame\CoopGame.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.
    2>Done building project "CoopGame.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========
    Attached Files
    Last edited by EminentEIement; 03-14-2020, 01:03 PM.

    #2
    SOLVED!

    I just need to add next in (yourProjectname.Build.cs file):

    Code:
    //...
    using UnrealBuildTool;
    
    public class CoopGame : ModuleRules
    {
        public CoopGame(ReadOnlyTargetRules Target) : base(Target)
        {
            PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
    
            PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "NavigationSystem" });
    //....
    But, nevertheless UE4 output log is horrible about this error as for developers
    Last edited by EminentEIement; 03-14-2020, 01:07 PM.

    Comment


      #3
      "unresolved external symbol" is a common linker(not compiler) error when you forgot add dependencies.
      Names looks scary because are mangled, but this is how C++ handle function overloading.

      Comment


        #4
        oh thank the lord i found this post, i must remember about linker's, cheers for the info
        My Mods: Armor+ Weapons+

        Comment

        Working...
        X