Hi, I tried searching and have tried a number of things but to no avail. I am including DateTime.h
in a file and I am getting the following error: 'LFDateTime': is not a class or namespace name
I have tried the following #include paths:
- Runtime/Core/Public/Misc/DateTime.h
- Core/Public/Misc/DateTime.h
- Public/Misc/DateTime.h
- Misc/DateTime.h
- DateTime.h
I have tried including them in both the .cpp
file and the .h
file. I have also tried including Core.h
and CoreMinimal.h
above them and by themselves. I wouldn’t expect most of these solutions to work, I’m just saying I’ve tried them.
Currently, my files are as follows:
MyClass.h
#include "GameFramework/Actor.h"
#include "Manager.generated.h"
UCLASS()
class TERRAINGENERATION_API AManager : public AActor
{
GENERATED_BODY()
public:
AManager();
protected:
virtual void BeginPlay() override;
public:
virtual void Tick(float DeltaTime) override;
};
MyClass.cpp
#include "Manager.h"
#include "Misc/DateTime.h"
AManager::AManager() {
PrimaryActorTick.bCanEverTick = true;
}
void AManager::BeginPlay() {
Super::BeginPlay();
}
void AManager::Tick(float DeltaTime) {
Super::Tick(DeltaTime);
if (GEngine) {
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, TEXT(FDateTime::Now()));
}
}
Thank you so much for your help!! I am new to C++ development in general and this is driving me crazy.