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"

Including Engine Header Error (Recast.h)

Hi together,

I want to process data from Recast in a Actor Subclass. In detail i want to process rcCompactHeightfield Data. So i tried to include Recast.h and it is found though my class won`t compile. How could i possibly circumvent this problem?

Actor Header:

 #pragma once
 #include "GameFramework/Actor.h"
 #include "Runtime/Navmesh/Public/Recast/Recast.h"
 #include "Runtime/Navmesh/Public/Recast/RecastAlloc.h"
 #include "Runtime/Navmesh/Public/Recast/RecastAssert.h"
 #include "MyProcessor.generated.h"
 
 UCLASS()
 class MYPROJECT_API AMyProcessor : public AActor
 {
     GENERATED_BODY()
     
 public:    
     // Sets default values for this actor's properties
     AMyProcessor();
 
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
     
     virtual void PostLoad() override;
     
     // Called every frame
     virtual void Tick( float DeltaSeconds ) override;
 
     void Process(rcCompactHeightfield& RasterContext);
 };
 

Actor cpp:

 #include "MyProject.h"
 #include "MyProcessor.h"
 
 // Sets default values
 AMyProcessor::AMyProcessor()
 {
      // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = true;
 
 }
 
 // Called when the game starts or when spawned
 void AMyProcessor::BeginPlay()
 {
     Super::BeginPlay();
     UE_LOG(LogTemp, Warning, TEXT("MyProcessor spawned"));
 }
 
 void AMyProcessor::PostLoad()
 {
     Super::PostLoad();
     UE_LOG(LogTemp, Warning, TEXT("MyProcessor loaded"));
 }
 
 
 // Called every frame
 void AMyProcessor::Tick( float DeltaTime )
 {
     Super::Tick( DeltaTime );
 
 }
 
 void Process(rcCompactHeightfield& RasterContext)
 {
     
 }
 

Error:

 Info /Users/leonardodapisa/Desktop/fork/UnrealEngine/Engine/Source/Runtime/Navmesh/Public/Recast/Recast.h:108:1: error: expected expression
 Info public:
 Info ^
 Info /Users/leonardodapisa/Desktop/fork/UnrealEngine/Engine/Source/Runtime/Navmesh/Public/Recast/Recast.h:106:19: error: variable has incomplete type 'class NAVMESH_API'
 Info class NAVMESH_API rcContext
 Info           ^


Obviously he has problem with the "NAVMESH_API" and so do i since i don`t understand at the moment where it is coming from.

Thanks in advance, alex

Product Version: UE 4.8
Tags:
more ▼

asked Aug 12 '15 at 01:34 PM in C++ Programming

avatar image

avision
10 1 6

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hello, avision

I am sorry to hear about your problem.

Please note that usage of some Unreal Engine 4 classes requires extra modules that may not be added to your project by default.

In this situation, it is most likely that the problem occurs because "Navmesh" module is not included. Thus, please open Build.cs file of your game (ProjectName/Source/ProjectName/ProjectName.Build.cs) and add Navmesh to the list of included modules:

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

In general, when you are going to use a class in your project for the first time, it is a good practise to check what module is class implemented in, and see if it is included in your project. To find a module, please go to class declaration (header file) or use online documentation (https://docs.unrealengine.com). At the bottom of the page, there is a "References" section, where you can obtain information about headers and modules that should be used: alt text

Hope this helped! Have a great day!

references.jpg (18.3 kB)
more ▼

answered Aug 17 '15 at 08:38 AM

avatar image

Andrii Melnyk
1.8k 60 19 111

avatar image avision Aug 19 '15 at 12:46 PM

Thanks a lot. This was indeed the problem. I thought it should be in cause the top-down example includes a NavMesh. But i overlooked that the project and the engine are in fact two builds.

(comments are locked)
10|2000 characters needed characters left
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