[SOLVED] Can't project point to navigation mesh

I’m getting this weird linker error:

unresolved external symbol "__declspec(dllimport) public: static class UNavigationSystemV1 * __cdecl UNavigationSystemV1::GetCurrent(class UWorld *)" (__imp_?GetCurrent@UNavigationSystemV1@@SAPEAV1@PEAVUWorld@@@Z) referenced in function "private: void __cdecl AVRCharacter::UpdateDestinationMarker(void)" (?UpdateDestinationMarker@AVRCharacter@@AEAAXXZ)

I’ve included the Navigation System:

#include "NavigationSystem.h"

And here’s the code that’s making the error:

UNavigationSystemV1* NavSystem = UNavigationSystemV1::GetCurrent(GetWorld());

If I try to use the function to project the point, I get the same time of linker error.
I’m using UE4 version 4.24.3.
I’ve tried to delete Build, Intermediate, and Saved and then rebuilding, but I get the same errors? Anyone know what’s wrong?

You need to add “NavigationSystem” to the Build.cs

I just did that, but now whenever I launch my project Unreal will crash. I tried removing the code I added, but it still crashes. It always crashes at 71%. All of my other projects work fine though.

This is what the crash reporter shows:

LoginId:e3f77d4c4a5eb2f8fe4fe9ac32292fbf
EpicAccountId:082bf23d1f6944b7b84bd4b3bb1e1afa

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000218

UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_CoreUObject
UE4Editor_Core
UE4Editor_Core
UE4Editor_Projects
UE4Editor_Projects
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
UE4Editor
kernel32
ntdll

Did you compile before reopening?

Yep, I’ve tried recompiling, clearing out build files, letting the engine build. I’ve even tried to remove the code that I added, and it still won’t work.

Sounds like an issue in one of your constructors then. To help pinpoint which one you could install the debug symbols in Unreal. You could also try commenting out constructor code and compiling to see if you can pinpoint the issue.

I figured out my problem! @sampattuzzi, it was a problem in my constructor. I was trying to set a member variable with CameraManager = GetWorld()->GetFirstPlayerController()->PlayerCameraManager;
But, as I should have known, the engine calls the constructor before play, seemingly on UE4 startup. I managed to fix this my moving my variable definition to the BeginPlay function. Thanks for all your help!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms