zaphoyd / websocketpp

C++ websocket client/server library
http://www.zaphoyd.com/websocketpp
Other
7.05k stars 1.97k forks source link

ndk r9 complier websocketpp #571

Open lwba21190 opened 8 years ago

lwba21190 commented 8 years ago

Dear zapgoyd, I am trying to complier websocket project with android ndk r6. But the following error was appearing: /websocket/websocketpp-master/websocketpp/transport/base/connection.hpp:187:18: error: looser throw specifier for 'virtual char const* websocketpp::transport::error::category::name() const' /home/boost_1_61_0/boost/system/error_code.hpp:190:32: error: overriding 'virtual char const* boost::system::error_category::name() const noexcept (true)' In file included from /home/websocket/websocketpp-master/websocketpp/transport/iostream/connection.hpp:31:0,

  The version od complier is 4.6. Can you tell me the reason? Thank you!
sevenjay commented 8 years ago

In past, it is not easy to build with Boost in Android. I don't know how about after ndk r10. http://stackoverflow.com/questions/7711029/boost-c-and-android-3 http://stackoverflow.com/questions/14036311/official-boost-library-support-for-android-and-ios

I use ndk r10d, r11c and r12b, all are built and run ok with standalone Asio and c++11.

zaphoyd commented 8 years ago

The likely issue is that either WebSocket++, Boost, and Asio don't agree on whether your system supports noexcept or not. It looks like boost is using noexcept and WebSocket++ is not.

You can try defining _WEBSOCKETPP_NOEXCEPT_ to force WebSocket++ to use it. You can also try (as @sevenjay mentioned) using a newer version of the tools that WebSocket++ is able to automatically detect noexcept support for.