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"

NavModifierComponent linker error

in DoorActor.h

 UPROPERTY(EditAnywhere, BlueprintReadOnly)
         class ANavModifierVolume* NavModifier;

in DoorActor.cpp

 #include "AI/Navigation/NavModifierVolume.h"
 #include "AI/Navigation/NavAreas/NavArea_Default.h"

 ...
 void ADoorActor::OpenDoor()
 {
     if(NavModifier != nullptr)
         NavModifier->SetAreaClass(UNavArea_Default::StaticClass());
 }

compiler error:

 Error    LNK2019    unresolved external symbol "public: void __cdecl ANavModifierVolume::SetAreaClass(class TSubclassOf<class UNavArea>)" (?SetAreaClass@ANavModifierVolume@@QEAAXV?$TSubclassOf@VUNavArea@@@@@Z) referenced in function "public: void __cdecl ADoorActor::OpenDoor(void)" (?OpenDoor@ADoorActor@@QEAAXXZ)    NavTest    D:\My Documents\Unreal\NavTest\Intermediate\ProjectFiles\DoorActor.cpp.obj    1    Build        
 

Is there a module I should include in the build file? NavModifierVolume appears to be in Engine; I've added that to PrivateDependencyModuleNames, with no success (Engine is already in Public by default).

I'm aware I can do what I'm trying to do with blueprint; I'm looking for C++ solution.

Product Version: UE 4.14
Tags:
more ▼

asked Feb 13 '17 at 08:30 PM in C++ Programming

avatar image

NullBlack
110 8 10 14

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

1 answer: sort voted first

See if changing:

 UCLASS(MinimalAPI, hidecategories=(Navigation))
 class ANavModifierVolume : public AVolume, public INavRelevantInterface

to

 UCLASS(hidecategories=(Navigation))
 class ENGINE_API ANavModifierVolume : public AVolume, public INavRelevantInterface

in NavModifierVolume.h helps. If so I'll make the change in the engine.

Cheers,

--mieszko

more ▼

answered Feb 14 '17 at 04:07 PM

avatar image

MieszkoZ STAFF
7.4k 225 57 414

avatar image NullBlack Feb 14 '17 at 04:33 PM

Got these errors.

 1>D:\Program Files\Epic Games\4.14\Engine\Source\Runtime\Engine\Classes\AI/Navigation/NavModifierVolume.h(16): error C2487: 'GetPrivateStaticClass': member of dll interface class may not be declared with dll interface
 1>D:\Program Files\Epic Games\4.14\Engine\Source\Runtime\Engine\Classes\AI/Navigation/NavModifierVolume.h(16): error C2487: 'ANavModifierVolume::{ctor}': member of dll interface class may not be declared with dll interface

I'm assuming modifying the source code in Program Files and building the project as normal is the correct process. The fact that I got new error messages seems to support this assumption.

avatar image MieszkoZ STAFF Feb 17 '17 at 02:17 PM

For this change to work you need to rebuild the engine (from the sources you can get from the github). I've just checked, making this change addresses linker error resulting from using NavModifierVolume in a game project. I'll submit the change, but you'll have to wait until 4.16 for it.. or get it from github! :D

(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