Fix compile error for linux platform

This commit is contained in:
dijunkun
2023-07-14 09:35:48 +08:00
parent 1c064a1cff
commit efc1e3bd85
3 changed files with 6 additions and 4 deletions

View File

@@ -131,6 +131,6 @@ void WsCore::OnPong(websocketpp::connection_hdl, std::string msg) {}
void WsCore::OnPongTimeout(websocketpp::connection_hdl, std::string msg) {} void WsCore::OnPongTimeout(websocketpp::connection_hdl, std::string msg) {}
void WsCore::OnMessage(websocketpp::connection_hdl, client::message_ptr &msg) { void WsCore::OnMessage(websocketpp::connection_hdl, client::message_ptr msg) {
OnReceiveMessage(msg->get_payload()); OnReceiveMessage(msg->get_payload());
} }

View File

@@ -39,7 +39,7 @@ class WsCore {
void OnPongTimeout(websocketpp::connection_hdl, std::string msg); void OnPongTimeout(websocketpp::connection_hdl, std::string msg);
void OnMessage(websocketpp::connection_hdl, client::message_ptr &msg); void OnMessage(websocketpp::connection_hdl, client::message_ptr msg);
virtual void OnReceiveMessage(const std::string &msg) = 0; virtual void OnReceiveMessage(const std::string &msg) = 0;

View File

@@ -16,10 +16,12 @@ add_defines("ASIO_STANDALONE", "ASIO_HAS_STD_TYPE_TRAITS", "ASIO_HAS_STD_SHARED_
if is_plat("windows") then if is_plat("windows") then
add_defines("_WEBSOCKETPP_CPP11_INTERNAL_") add_defines("_WEBSOCKETPP_CPP11_INTERNAL_")
add_links("ws2_32", "Bcrypt")
elseif is_plat("linux") then
add_links("pthread")
set_config("cxxflags", "-fPIC")
end end
add_links("ws2_32", "Bcrypt")
add_cxflags("-MD")
add_packages("spdlog") add_packages("spdlog")
includes("thirdparty") includes("thirdparty")