cpprestsdk icon indicating copy to clipboard operation
cpprestsdk copied to clipboard

Unreal Engine 4 integration | does not compile

Open araratmna opened this issue 9 years ago • 0 comments

Can anybody help me to integrate cpprestsdk on my Unreal Engine 4 project. I've created an empty project with visual studio, it works perfect, but when I want to use it in Unreal Engine 4, It does not compile.

I have included and used the namespaces and headers.

#include <cpprest/ws_client.h> #include <cpprest/filestream.h> using namespace web; using namespace web::websockets::client;

Then I've declared a variable on my header file class websocket_client* client;

And my function looks like this client.connect(U("wws://mywebsocket")).then( { sendMessage("Hello WebSocket"); }).wait();

It shows this error. 2>D:\Project\WebSocket\MySocket.cpp(35): error C2065: 'Lhost': undeclared identifier 2>D:\Project\WebSocket\MySocket.cpp(35): error C2228: left of '.then' must have class/struct/union 2>D:\Project\WebSocket\MySocket.cpp(40): error C3861: 'sendMessage': identifier not found 2>D:\Project\WebSocket\MySocket.cpp(42): error C2228: left of '.wait' must have class/struct/union 2>ERROR : UBT error : Failed to produce item: D:\Project\WebSocket\Binaries\Win64\UE4Editor-WebSocket-6372.dll

araratmna avatar Apr 11 '17 07:04 araratmna