Hi
I'm having problem with compile sample program.
pi@zero:~/paho.mqtt.cpp/src/samples $ g++ async_publish.cpp -o test
/tmp/ccRraZrG.o: In function `main':
async_publish.cpp:(.text+0x424): undefined reference to `mqtt::async_client::async_client(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mqtt::iclient_persistence*)'
async_publish.cpp:(.text+0x444): undefined reference to `mqtt::async_client::set_callback(mqtt::callback&)'
async_publish.cpp:(.text+0x450): undefined reference to `mqtt::connect_options::connect_options()'
async_publish.cpp:(.text+0x49c): undefined reference to `mqtt::message::message(mqtt::buffer_ref<char>, mqtt::buffer_ref<char>, int, bool)'
async_publish.cpp:(.text+0x4d8): undefined reference to `mqtt::will_options::will_options(mqtt::message const&)'
async_publish.cpp:(.text+0x4f4): undefined reference to `mqtt::connect_options::set_will(mqtt::will_options const&)'
async_publish.cpp:(.text+0x540): undefined reference to `mqtt::connect_options::connect_options(mqtt::connect_options const&)'
async_publish.cpp:(.text+0x558): undefined reference to `mqtt::async_client::connect(mqtt::connect_options)'
async_publish.cpp:(.text+0x690): undefined reference to `mqtt::async_client::publish(std::shared_ptr<mqtt::message const>)'
async_publish.cpp:(.text+0x760): undefined reference to `mqtt::async_client::publish(mqtt::buffer_ref<char>, void const*, unsigned int, int, bool)'
async_publish.cpp:(.text+0x9b0): undefined reference to `mqtt::async_client::publish(std::shared_ptr<mqtt::message const>, void*, mqtt::iaction_listener&)'
async_publish.cpp:(.text+0xb14): undefined reference to `mqtt::async_client::publish(std::shared_ptr<mqtt::message const>, void*, mqtt::iaction_listener&)'
async_publish.cpp:(.text+0xbb8): undefined reference to `mqtt::async_client::get_pending_delivery_tokens() const'
async_publish.cpp:(.text+0xd54): undefined reference to `mqtt::async_client::~async_client()'
async_publish.cpp:(.text+0x1090): undefined reference to `mqtt::async_client::~async_client()'
/tmp/ccRraZrG.o: In function `mqtt::message::create(mqtt::buffer_ref<char>, mqtt::buffer_ref<char>)':
async_publish.cpp:(.text._ZN4mqtt7message6createENS_10buffer_refIcEES2_[_ZN4mqtt7message6createENS_10buffer_refIcEES2_]+0x54): undefined reference to `mqtt::message::DFLT_RETAINED'
async_publish.cpp:(.text._ZN4mqtt7message6createENS_10buffer_refIcEES2_[_ZN4mqtt7message6createENS_10buffer_refIcEES2_]+0x58): undefined reference to `mqtt::message::DFLT_QOS'
/tmp/ccRraZrG.o: In function `mqtt::message::get_payload[abi:cxx11]() const':
async_publish.cpp:(.text._ZNK4mqtt7message11get_payloadB5cxx11Ev[_ZNK4mqtt7message11get_payloadB5cxx11Ev]+0x54): undefined reference to `mqtt::message::EMPTY_BIN[abi:cxx11]'
/tmp/ccRraZrG.o: In function `mqtt::async_client::disconnect()':
async_publish.cpp:(.text._ZN4mqtt12async_client10disconnectEv[_ZN4mqtt12async_client10disconnectEv]+0x2c): undefined reference to `mqtt::disconnect_options::disconnect_options()'
/tmp/ccRraZrG.o: In function `void __gnu_cxx::new_allocator<mqtt::message>::construct<mqtt::message, mqtt::buffer_ref<char>, mqtt::buffer_ref<char>, int const&, bool const&>(mqtt::message*, mqtt::buffer_ref<char>&&, mqtt::buffer_ref<char>&&, int const&, bool const&)':
async_publish.cpp:(.text._ZN9__gnu_cxx13new_allocatorIN4mqtt7messageEE9constructIS2_JNS1_10buffer_refIcEES6_RKiRKbEEEvPT_DpOT0_[_ZN9__gnu_cxx13new_allocatorIN4mqtt7messageEE9constructIS2_JNS1_10buffer_refIcEES6_RKiRKbEEEvPT_DpOT0_]+0xac): undefined reference to `mqtt::message::message(mqtt::buffer_ref<char>, mqtt::buffer_ref<char>, int, bool)'
collect2: error: ld returned 1 exit status