rdeioris / LuaMachine

Unreal Engine Plugin for Lua APIs implementation
MIT License
581 stars 120 forks source link

UE5: Couldn't build on linux as PlatformFilemanager.h was renamed #39

Closed asusha94 closed 11 months ago

asusha94 commented 2 years ago

Hi

I've added the plugin into my project but it can't be compiled:

Plugins/LuaMachine/Source/LuaMachine/Private/LuaBlueprintFunctionLibrary.cpp:15:10: fatal error: 'HAL/PlatformFilemanager.h' file not found
#include "HAL/PlatformFilemanager.h"

I've found that the file has a new name in UE5: HAL/PlatformFileManager.h. I suppose building projects is not affected on Windows as its filesystem is case insensitive.

Here is a possible fix. I couldn't make a pull request myself.

#if !defined(ENGINE_MAJOR_VERSION) || ENGINE_MAJOR_VERSION < 5
#include "HAL/PlatformFilemanager.h"  // UE4
#else
#include "HAL/PlatformFileManager.h"  // UE5
#endif

It works with UE5 but I haven't tested with UE4 (maybe there is no need in !defined(ENGINE_MAJOR_VERSION) part).

Could someone add this? Thanks

Olathuss commented 1 year ago

Sorry, didn't catch the "M" being lowercase in one and upper in the other. Looks like it has been updated to use the updated header.

knapsu commented 1 year ago

No, it has not been fixed. I've created a pull request.