I tried to include a header conditionally, but I am getting the following error:
“In MyActor: Unmatched ‘#endif’ in class or global scope”
Here is the relevant part of the header I am using #ifdef in:
#pragma once
#ifdef MYDEFINITION
#include "Foo.h"
#endif
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"
UCLASS()
class AMyActor : public AActor
The header inside ifdef/endif isn’t important - I get the same error even when there’s nothing between ifdef and endif.
Is there a way around this problem?