Create Directory is not a Member of IPlatform

When updating I’m getting an error with all of my file access functions. When looking into the object I see that the functions are there adn the implementation and useage mathces those used in the engine. Not sure why this error is occuring.

2>C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(536): warning C4005: 'TEXT': macro redefinition
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\HAL/Platform.h(782): note: see previous definition of 'TEXT'
2>C:\Program Files (x86)\Windows Kits\8.1\include\um\winnt.h(17005): warning C4668: '_APISET_RTLSUPPORT_VER' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
2>C:\Program Files (x86)\Windows Kits\8.1\include\um\interlockedapi.h(73): warning C4668: '_APISET_INTERLOCKED_VER' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
2>C:\Program Files (x86)\Windows Kits\8.1\include\um\processthreadsapi.h(1170): warning C4668: '_WIN32_WINNT_WINTHRESHOLD' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
2>C:\Program Files (x86)\Windows Kits\8.1\include\um\securitybaseapi.h(357): warning C4668: '_APISET_SECURITYBASE_VER' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
2>C:\Program Files (x86)\Windows Kits\8.1\include\um\securitybaseapi.h(472): warning C4668: '_APISET_SECURITYBASE_VER' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
2>C:\Program Files (x86)\Windows Kits\8.1\include\um\securitybaseapi.h(1302): warning C4668: '_APISET_SECURITYBASE_VER' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
2>C:\Program Files (x86)\Windows Kits\8.1\include\um\winbase.h(8618): warning C4668: 'NTDDI_WIN7SP1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(61): error C2039: 'CreateDirectoryW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(83): error C2039: 'CopyFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(103): error C2039: 'CopyFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(144): error C2039: 'DeleteFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(153): error C2039: 'DeleteFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(2045): error C2039: 'DeleteFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(2090): error C2039: 'CopyFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(2162): error C2039: 'DeleteFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(2171): error C2039: 'CopyFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(2181): error C2039: 'DeleteFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'
2>C:\Users\kevin\Documents\Unreal Projects\RPGPluginTest_415\Plugins\RPGEngineToolKit\Source\RPGEngineToolKit\Private\Datastores\RPG_Party.cpp(2187): error C2039: 'CopyFileW': is not a member of 'IPlatformFile'
2>  c:\program files\epic games\4.15\engine\source\runtime\core\public\GenericPlatform/GenericPlatformFile.h(160): note: see declaration of 'IPlatformFile'

Hi Shoiko,

At first glance, this appears that it may be some fallout from the Engine changing to an Include What You Use model. I gather that everything worked fine in 4.14, and it is only in 4.15 that this began to occur? I would recommend double-checking your includes to make sure something that was previously included by the Engine is now specifically included in the file(s) where you are using it.

I’ve tried this by looking a the other methods in engine where they are using the same methods, ive used the same headers as well as checking the modules used for all header types. This issue still persist.

I’ve also tried the windows specific version of file IO class and its not working either. Can’t get the class to instance.

Explaining more of what im seeing and what ive tried:

I am using UE4’s built in file access functions. And in the latest release these have borked for me. When I look at the error it seems that its not really an error per se with an included head it looks like there is a conflict with windows SDK and the engine when it comes the the windows defined call back. Because of the way that the warnings appear as well it seems like macro redefinition should not be happening with the WinSDK and the Hal/platform.h. but extending down from those warnings I am getting CreateDirectoryW is not a member of IPlatform profile which CreateDirectoryW is the windows definition of the function and the actual function being called is: CreateDirectory which is defined. But there seems to be something missing to make this compile correctly. Even at first glance I’ve tried to add windows.h and other things needed to use the basic CreateDirectoryW functionality. I’ve looked into the engine to see where they used the same features and mirrored those usages and header includes with no success. If anyone can give me any tips that maybe i’m just blatantly missing id be much appreciative

okay i found it. i had one engine.H file included in a file that was tucked away >.<

Hi Shoiko,

I am glad to hear that you were able to resolve this issue. Please let us know if you run into any additional issues related to this.

I wanted to add data to this: I had windows.h also included for file access. I had to remove this and use the built in ue4 calls for file access. I also had to remove engine.h as started above. and replaced it with #include “EngineMinimal.h” for now. The rest of the changes involved adding the specific headers for a few objects.

1 Like

I have had the same problem and my solution was use other class.

I was trying use this one:

 FPlatformFileManager::Get().GetPlatformFile().CopyFile(DestinyPath, SourcePath);

But work for me this:

 IFileManager.Get().Copy(DestinyPath, SourcePath);

How? Please explain more!