Hi,
I am new to UE as well as c++. Recently I have implemented a custom BLE client using c++/WinRT and successfully tested it in a standalone console app. When I began porting the core logic over to UE5.4.3 as a UActorComponent under a UE c++ project, I encountered the following error:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt\winrt\base.h(261): error C4668: '_M_IX86' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
After a great deal of trial and error, I stumbled onto a “solution”; it appears that if I added an additional #include "Windows/PreWindowsApi.h"
, I am able to bypass this error and eventually getting the code to compile. This header file was never needed in the standalone console app I successfully tested, I am curious why it’s needed when compiling with UE5.