lundi 30 mai 2016

Error using Paho C++ libraries

Good morning,

I'm having some problems while using Paho C++ library. I installed Paho C libraries first following the steps:

git clone http://ift.tt/1TQrdkc
cd org.eclipse.paho.mqtt.c.git
make
sudo make install

After that I did the same with the C++ library:

git clone http://ift.tt/1XIaFO0
cd org.eclipse.paho.mqtt.cpp.git
make

In order to try to check the library, I tried to compile the /src/samples using:

make

I got an error lmqttv3a and mqttpp libraries weren't found so I modified the make file and I got rid of this problem.

Now, while compiling this I have another new error, it seems the compiler is not getting properly the libraries. The new error is:

:~/http://ift.tt/1TQqT54 make g++ -I.. -I/usr/local/lib/src -D_NDEBUG -Wall -std=c++0x -O2 -o asy_publish.o async_publish.cpp -L../lib -L/usr/local/lib/src/linux_ia64 /tmp/cc4UUHz6.o: In function std::_Sp_counted_ptr_inplace<mqtt::message, std::allocator<mqtt::message>, (__gnu_cxx::_Lock_policy)2>::_M_dispose()': async_publish.cpp:(.text._ZNSt23_Sp_counted_ptr_inplaceIN4mqtt7messageESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv[_ZNSt23_Sp_counted_ptr_inplaceIN4mqtt7messageESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv]+0x5): undefined reference tomqtt::message::~message()' /tmp/cc4UUHz6.o: In function _ZNSt12__shared_ptrIN4mqtt7messageELN9__gnu_cxx12_Lock_policyE2EEC1ISaIS1_EJRPKcEEESt19_Sp_make_shared_tagRKT_DpOT0_': async_publish.cpp:(.text._ZNSt12__shared_ptrIN4mqtt7messageELN9__gnu_cxx12_Lock_policyE2EEC2ISaIS1_EIRPKcEEESt19_Sp_make_shared_tagRKT_DpOT0_[_ZNSt12__shared_ptrIN4mqtt7messageELN9__gnu_cxx12_Lock_policyE2EEC5ISaIS1_EIRPKcEEESt19_Sp_make_shared_tagRKT_DpOT0_]+0x5c): undefined reference tomqtt::message::message(std::string const&)' /tmp/cc4UUHz6.o: In function main': async_publish.cpp:(.text.startup+0x121): undefined reference to mqtt::async_client::async_client(std::string const&, std::string const&)' async_publish.cpp:(.text.startup+0x13f): undefined reference to mqtt::async_client::set_callback(mqtt::callback&)' async_publish.cpp:(.text.startup+0x152): undefined reference to mqtt::async_client::connect()' async_publish.cpp:(.text.startup+0x223): undefined reference to mqtt::async_client::publish(std::string const&, std::shared_ptr<mqtt::message>)' async_publish.cpp:(.text.startup+0x2c5): undefined reference to mqtt::async_client::publish(std::string const&, void const*, unsigned long, int, bool)' async_publish.cpp:(.text.startup+0x3ea): undefined reference to mqtt::async_client::publish(std::string const&, std::shared_ptr<mqtt::message>, void*, mqtt::iaction_listener&)' async_publish.cpp:(.text.startup+0x556): undefined reference to mqtt::async_client::publish(std::string const&, std::shared_ptr, void*, mqtt::iaction_listener&)' async_publish.cpp:(.text.startup+0x5d3): undefined reference to mqtt::async_client::get_pending_delivery_tokens() const' async_publish.cpp:(.text.startup+0x6e8): undefined reference to mqtt::async_client::~async_client()' async_publish.cpp:(.text.startup+0x713): undefined reference to `mqtt::async_client::~async_client()' collect2: error: ld returned 1 exit status make: *** [async_publish] Error 1

Can anyone help me?

Thank you very much.

Aucun commentaire:

Enregistrer un commentaire