I'm trying to work on WebSocket in C++ using websocketpp library. I have cloned this library https://github.com/zaphoyd/websocketpp in my system and build it using "cmake -G "MinGW Makefiles". Now the source code which I have created outside this repository.
#include <iostream>
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
typedef websocketpp::server<websocketpp::config::asio> server;
void on_message(websocketpp::connection_hdl hdl, server::message_ptr msg) {
std::cout << msg->get_payload() << std::endl;
}
int main() {
server print_server;
print_server.set_message_handler(&on_message);
print_server.init_asio();
print_server.listen(9002);
print_server.start_accept();
print_server.run();
}
is throwing error:
fatal error: websocketpp/config/asio_no_tls.hpp: No such file or directory
#include <websocketpp/config/asio_no_tls.hpp>
although this file is available in directory. Since I'm not getting any issue with this line #include <websocketpp/server.hpp>
. Clicking on option more I found this error
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit
Anyone help it out with what needs to be done. I'm editing it in VS code and using MinGW. this is the properties.json file
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/gcc.exe",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4