aws-samples / aws-iot-securetunneling-localproxy

AWS Iot Secure Tunneling local proxy reference C++ implementation
https://docs.aws.amazon.com/iot/latest/developerguide/what-is-secure-tunneling.html
Apache License 2.0
73 stars 69 forks source link

Make issue for mac - error: no member named 'to_string' #117

Closed monelgordillo closed 1 year ago

monelgordillo commented 1 year ago

Describe the bug

I'm running until an issue during make on macos.

make
[  4%] Running cpp protocol buffer compiler on /Users/XXX/Downloads/aws-iot-device-client/aws-iot-securetunneling-localproxy/resources/Message.proto
[  8%] Building CXX object CMakeFiles/localproxy.dir/src/main.cpp.o
[ 12%] Building CXX object CMakeFiles/localproxy.dir/src/TcpAdapterProxy.cpp.o
/Users/XXX/Downloads/aws-iot-device-client/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:187:113: error: no member named 'to_string' in 'boost::core::basic_string_view<char>'
                BOOST_LOG_SEV(log, error) << "Failed web socket session ID: " << tac.wss_response["channel-id"].to_string();
                                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/XXX/Downloads/aws-iot-device-client/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:839:105: error: no member named 'to_string' in 'boost::core::basic_string_view<char>'
                BOOST_LOG_SEV(log, info) << "Web socket session ID: " << tac.wss_response["channel-id"].to_string();
                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/XXX/Downloads/aws-iot-device-client/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:844:153: error: no member named 'to_string' in 'boost::core::basic_string_view<char>'
                BOOST_LOG_SEV(log, debug) << "Web socket subprotocol selected: " << tac.wss_response[boost::beast::http::field::sec_websocket_protocol].to_string();
                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
3 errors generated.
make[2]: *** [CMakeFiles/localproxy.dir/src/TcpAdapterProxy.cpp.o] Error 1
make[1]: *** [CMakeFiles/localproxy.dir/all] Error 2
make: *** [all] Error 2

To Reproduce

Steps to reproduce the behavior:

git clone https://github.com/aws-samples/aws-iot-securetunneling-localproxy
cd aws-iot-securetunneling-localproxy
mkdir build
cd build
cmake ../
make

Environment (please complete the following information):

xlcheng1 commented 1 year ago

Hello @monelgordillo , thanks for reaching out! Could you specify the version of boost you are using?

monelgordillo commented 1 year ago

Boost 1.81

RogerZhongAWS commented 1 year ago

cross-referencing #112

monelgordillo commented 1 year ago

Sounds like I should try an older version of boost. I'll try it.

monelgordillo commented 1 year ago

I was able to get passed the issue with boost version 1.79.0:

cmake -DBOOST_PKG_VERSION=1.79.0 ../