PostWindowsApi build error

Hello,

I’m using a lib, mongoose to setup a websocket server in unreal.
In the project everything works pretty well but as soon as i try to put the code in a plugin i cannot compile my project, i have weird PostWindowsApi.h errors.
Here are my includes in the beggining on my .cpp file :



#define WIN32_LEAN_AND_MEAN
#include "WebSocketServer.h"
#include "GenericPlatform/GenericPlatformProcess.h"
#include "GenericPlatform/GenericPlatformAffinity.h"

#include "Windows/AllowWindowsPlatformTypes.h"
#include "Windows/prewindowsapi.h"
#include "mongoose.h"
#include "lz4.h"
#include "Windows/PostWindowsApi.h"
#include "Windows/HideWindowsPlatformTypes.h"


Here are the errors produced by the build :

Error (active) E1097 unknown attribute “no_init_all” WebImGUI C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h 3886
Error C4193 #pragma warning(pop): no matching ‘#pragma warning(push)’ WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\PostWindowsApi.h 4
Error C4602 #pragma pop_macro: ‘MAX_uint8’ no previous #pragma push_macro for this identifier WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\PostWindowsApi.h 65
Error C4602 #pragma pop_macro: ‘MAX_uint16’ no previous #pragma push_macro for this identifier WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\PostWindowsApi.h 66
Error C4602 #pragma pop_macro: ‘MAX_uint32’ no previous #pragma push_macro for this identifier WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\PostWindowsApi.h 67
Error C4602 #pragma pop_macro: ‘MAX_int32’ no previous #pragma push_macro for this identifier WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\PostWindowsApi.h 68
Error C4602 #pragma pop_macro: ‘TEXT’ no previous #pragma push_macro for this identifier WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\PostWindowsApi.h 69
Error C4602 #pragma pop_macro: ‘TRUE’ no previous #pragma push_macro for this identifier WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\PostWindowsApi.h 70
Error C4602 #pragma pop_macro: ‘FALSE’ no previous #pragma push_macro for this identifier WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\PostWindowsApi.h 71
Error C1189 #error: Mismatched HideWindowsPLatformTypes.h detected. WebImGUI C:\Program Files\Epic Games\UE_4.22\Engine\Source\Runtime\Core\Public\Windows\HideWindowsPlatformTypes.h 6

I’m not very familiar with including windows api stuff and i can’t figure out why this work in project but not in plugins.

Cheers

Update : i tried even in a whole new c++ project with nothing inside, put that in a new module, still doesn’t work and the same errors are raised.

1 Like