Cpprestsdk within unreal engine

Hey,

I am currrently trying to use the cpprestapi together with unreal engine but unfornutally I always get errors while compiling. Here is the error log:

CompilerResultsLog: Error: [...]\vcpkg\installed\x64-windows\include\pplx/pplxtasks.h(19) : warning C4668: 'CPPREST_FORCE_PPLX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
CompilerResultsLog: Error: [...]\vcpkg\installed\x64-windows\include\pplx/pplxtasks.h(19) : warning C4668: 'CPPREST_FORCE_PPLX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
CompilerResultsLog: Error: [...]\vcpkg\installed\x64-windows\include\cpprest/json.h(304) : warning C4628: digraphs not supported with -Ze. Character sequence '<:' not interpreted as alternate token for '['
CompilerResultsLog: Error: [...]\vcpkg\installed\x64-windows\include\cpprest/json.h(304) : warning C4628: digraphs not supported with -Ze. Character sequence '<:' not interpreted as alternate token for '['
CompilerResultsLog: Error: [...]\vcpkg\installed\x64-windows\include\cpprest/details/web_utilities.h(36) : warning C4628: digraphs not supported with -Ze. Character sequence '<:' not interpreted as alternate token for '['
CompilerResultsLog: Error: [...]\vcpkg\installed\x64-windows\include\cpprest/http_client.h(760) : warning C4628: digraphs not supported with -Ze. Character sequence '<:' not interpreted as alternate token for '['
CompilerResultsLog: Error: [...]\vcpkg\installed\x64-windows\include\cpprest/details/web_utilities.h(36) : warning C4628: digraphs not supported with -Ze. Character sequence '<:' not interpreted as alternate token for '['
CompilerResultsLog: Error: [...]vcpkg\installed\x64-windows\include\cpprest/http_client.h(760) : warning C4628: digraphs not supported with -Ze. Character sequence '<:' not interpreted as alternate token for '['
CompilerResultsLog: c:\program files (x86)\microsoft visual studio 14.0\vc\include\ppltasks.h(4321) : error C4868: compiler may not enforce left-to-right evaluation order in braced initializer list
CompilerResultsLog: c:\program files (x86)\microsoft visual studio 14.0\vc\include\ppltasks.h(4321) : error C4868: compiler may not enforce left-to-right evaluation order in braced initializer list
CompilerResultsLog: ERROR: UBT ERROR: Failed to produce item: [...]\Binaries\Win64\UE4Editor-MyShooter-824.dll
CompilerResultsLog: Total build time: 25,51 seconds (Local executor: 0,00 seconds)

I have installed cpprestapi with the vcpkg manager.
My .build.cs looks like this:

PublicIncludePaths.Add([...]/vcpkg/installed/x64-windows/include");

I have also added this folder to the NMake include dir list and in the normal vs one.

Compiling a minimal c++ project without unreal engine works flawless.

The #include <cpprest/http_client.h>gets called within the derived GameInstance class.

I also am getting these errors. Exact same setup. Did you get this resolved?

I was not able to get it to work. However I was able to use the FHttpModule which comes with unreal.
Http-requests is a great example on how you can use this module. This should be a good start for you!

In case someone else stumbles onto this problem… You can get around it by adding your own definition for CPPREST_FORCE_PPLX in the .build.cs file:

PublicDefinitions.Add("CPPREST_FORCE_PPLX=0");