I installed boost 1.60.0 manually by compiling it and installed libssl-dev alongside on my latest raspberrypi OS install.
Then I tried to compile your code and got this error
/usr/local/include/boost/asio/ssl/impl/context.ipp: In member function ‘boost::system::error_code boost::asio::ssl::context::use_rsa_private_key(const boost::asio::const_buffer&, boost::asio::ssl::context_base::file_format, boost::system::error_code&)’:
/usr/local/include/boost/asio/ssl/impl/context.ipp:716:28: error: invalid use of incomplete type ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
716 | bio.p, 0, handle_->default_passwd_callback,
| ^~
In file included from /usr/include/openssl/crypto.h:25,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/conf.h:13,
from /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19,
from /usr/local/include/boost/asio/ssl/context_base.hpp:19,
from /usr/local/include/boost/asio/ssl/context.hpp:27,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/include/openssl/ossl_typ.h:149:16: note: forward declaration of ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
149 | typedef struct ssl_ctx_st SSL_CTX;
| ^~~~~~~~~~
In file included from /usr/local/include/boost/asio/ssl/context.hpp:786,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/local/include/boost/asio/ssl/impl/context.ipp:717:18: error: invalid use of incomplete type ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
717 | handle_->default_passwd_callback_userdata);
| ^~
In file included from /usr/include/openssl/crypto.h:25,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/conf.h:13,
from /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19,
from /usr/local/include/boost/asio/ssl/context_base.hpp:19,
from /usr/local/include/boost/asio/ssl/context.hpp:27,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/include/openssl/ossl_typ.h:149:16: note: forward declaration of ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
149 | typedef struct ssl_ctx_st SSL_CTX;
| ^~~~~~~~~~
In file included from /usr/local/include/boost/asio/ssl/context.hpp:786,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/local/include/boost/asio/ssl/impl/context.ipp: In member function ‘boost::system::error_code boost::asio::ssl::context::do_set_password_callback(boost::asio::ssl::detail::password_callback_base*, boost::system::error_code&)’:
/usr/local/include/boost/asio/ssl/impl/context.ipp:936:14: error: invalid use of incomplete type ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
936 | if (handle_->default_passwd_callback_userdata)
| ^~
In file included from /usr/include/openssl/crypto.h:25,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/conf.h:13,
from /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19,
from /usr/local/include/boost/asio/ssl/context_base.hpp:19,
from /usr/local/include/boost/asio/ssl/context.hpp:27,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/include/openssl/ossl_typ.h:149:16: note: forward declaration of ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
149 | typedef struct ssl_ctx_st SSL_CTX;
| ^~~~~~~~~~
In file included from /usr/local/include/boost/asio/ssl/context.hpp:786,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/local/include/boost/asio/ssl/impl/context.ipp:938:16: error: invalid use of incomplete type ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
938 | handle_->default_passwd_callback_userdata);
| ^~
In file included from /usr/include/openssl/crypto.h:25,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/conf.h:13,
from /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19,
from /usr/local/include/boost/asio/ssl/context_base.hpp:19,
from /usr/local/include/boost/asio/ssl/context.hpp:27,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/include/openssl/ossl_typ.h:149:16: note: forward declaration of ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
149 | typedef struct ssl_ctx_st SSL_CTX;
| ^~~~~~~~~~
In file included from /usr/local/include/boost/asio/ssl/context.hpp:786,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/local/include/boost/asio/ssl/impl/context.ipp:940:10: error: invalid use of incomplete type ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
940 | handle_->default_passwd_callback_userdata = callback;
| ^~
In file included from /usr/include/openssl/crypto.h:25,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/conf.h:13,
from /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19,
from /usr/local/include/boost/asio/ssl/context_base.hpp:19,
from /usr/local/include/boost/asio/ssl/context.hpp:27,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/include/openssl/ossl_typ.h:149:16: note: forward declaration of ‘SSL_CTX’ {aka ‘struct ssl_ctx_st’}
149 | typedef struct ssl_ctx_st SSL_CTX;
| ^~~~~~~~~~
In file included from /usr/include/openssl/engine.h:25,
from /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:22,
from /usr/local/include/boost/asio/ssl/context_base.hpp:19,
from /usr/local/include/boost/asio/ssl/context.hpp:27,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/local/include/boost/asio/ssl/detail/impl/engine.ipp: In member function ‘const boost::system::error_code& boost::asio::ssl::detail::engine::map_error_code(boost::system::error_code&) const’:
/usr/local/include/boost/asio/ssl/detail/impl/engine.ipp:207:9: error: ‘SSL_R_SHORT_READ’ was not declared in this scope; did you mean ‘SSL_F_SSL_READ’?
207 | ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ),
| ^~~~~~~~
In file included from /usr/local/include/boost/asio/ssl/detail/engine.hpp:163,
from /usr/local/include/boost/asio/ssl/detail/buffered_handshake_op.hpp:21,
from /usr/local/include/boost/asio/ssl/stream.hpp:29,
from /usr/local/include/boost/asio/ssl.hpp:24,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/local/include/boost/asio/ssl/detail/impl/engine.ipp:214:11: error: invalid use of incomplete type ‘SSL’ {aka ‘struct ssl_st’}
214 | if (ssl_->version == SSL2_VERSION)
| ^~
In file included from /usr/include/openssl/crypto.h:25,
from /usr/include/openssl/bio.h:20,
from /usr/include/openssl/conf.h:13,
from /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:19,
from /usr/local/include/boost/asio/ssl/context_base.hpp:19,
from /usr/local/include/boost/asio/ssl/context.hpp:27,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/include/openssl/ossl_typ.h:148:16: note: forward declaration of ‘SSL’ {aka ‘struct ssl_st’}
148 | typedef struct ssl_st SSL;
| ^~~~~~
In file included from /usr/include/openssl/engine.h:25,
from /usr/local/include/boost/asio/ssl/detail/openssl_types.hpp:22,
from /usr/local/include/boost/asio/ssl/context_base.hpp:19,
from /usr/local/include/boost/asio/ssl/context.hpp:27,
from /usr/local/include/boost/asio/ssl.hpp:19,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:27,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/usr/local/include/boost/asio/ssl/detail/impl/engine.ipp:221:9: error: ‘SSL_R_SHORT_READ’ was not declared in this scope; did you mean ‘SSL_F_SSL_READ’?
221 | ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ),
| ^~~~~~~~
In file included from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/client.hpp:36,
from /home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt_client_cpp.hpp:8,
from /home/pi/AqaraHub/src/mqtt_wrapper_impl.h:3,
from /home/pi/AqaraHub/src/mqtt_wrapper.cpp:4:
/home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/endpoint.hpp: In member function ‘bool mqtt::endpoint<Socket, Mutex, LockGuard>::handle_close_or_error(const boost::system::error_code&)’:
/home/pi/AqaraHub/submodules/mqtt_cpp/include/mqtt/endpoint.hpp:2355:61: error: ‘boost::asio::ssl::error’ has not been declared
2355 | ERR_GET_REASON(ec.value()) == boost::asio::ssl::error::stream_truncated
| ^~~~~
make[2]: *** [CMakeFiles/common.dir/build.make:173: CMakeFiles/common.dir/src/mqtt_wrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:126: CMakeFiles/common.dir/all] Error 2
make: *** [Makefile:149: all] Error 2