Compilation errors on QNX 6.6.0
Compiler: QCC 4.7.3 Include headers:
include <websocketpp/config/asio_no_tls.hpp>
include <websocketpp/server.hpp>
include
Compilation errors: C:/Develop/qnx-cpp/libs/websocketpp/websocketpp/utilities.hpp: In member function 'bool websocketpp::utility::ci_less::nocase_compare::operator()(const unsigned char&, const unsigned char&) const': C:/Develop/qnx-cpp/libs/websocketpp/websocketpp/utilities.hpp:81:31: error: 'tolower' was not declared in this scope
C:/Develop/qnx-cpp/libs/websocketpp/websocketpp/impl/utilities_impl.hpp: In function 'std::string websocketpp::utility::to_lower(const string&)': C:/Develop/qnx-cpp/libs/websocketpp/websocketpp/impl/utilities_impl.hpp:39:54: error: '::tolower' has not been declared
C:/Develop/qnx-cpp/libs/websocketpp/websocketpp/transport/asio/connection.hpp: In member function 'void websocketpp::transport::asio::connection
C:/Develop/qnx-cpp/libs/websocketpp/websocketpp/transport/asio/connection.hpp:882:42: error: ambiguous overload for 'operator==' in 'tec == websocketpp::transport::error::pass_through'
C:/Develop/qnx-cpp/libs/websocketpp/websocketpp/transport/asio/connection.hpp:882:42: note: candidates are:
C:/Develop/qnx-cpp/libs/websocketpp/websocketpp/transport/asio/connection.hpp:882:42: note: operator==(int, int)
There are several more compilation errors regarding the error codes but I assume that most of them have the same source,
Correct headers are:
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
#include <iostream>
Had this problem while using websocketpp. The fix was to change the to_lower function in utilities_impl.hpp [line 37] as described in cppreference.com Apparently the use of ::tolower could conflict with other libs.
inline std::string to_lower(std::string const &in)
{
std::string out = in;
std::transform(out.begin(), out.end(), out.begin(), [](unsigned char c) { return std::tolower(c); });
return out;
}
reference: https://en.cppreference.com/w/cpp/string/byte/tolower