Error -> Create connection

75 views
Skip to first unread message

Ruben Ferreira

unread,
Nov 15, 2016, 3:33:43 AM11/15/16
to simpleamqpclient-users

hi :)


I try this library but i have the follow error:


"obj/Debug/main.o: In function `boost::detail::sp_if_not_arrayAmqpClient::Channel::type boost::make_shared<AmqpClient::Channel, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int&>(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int&)':"


My main class only have this line (as in the example)


AmqpClient::Channel::ptr_t connection = AmqpClient::Channel::Create("localhost");


I dont understand the error. This error appear when i try to build the code in codeblocks. I have the SimplesAmqpClient.h include and not appear any error before i build the code.


I use this library (SimpleAmqpClient), rabbitmq-c-0.8.0 and Ubuntu 16.04.1 LTS.


It is important to refer when this error occurs, the codeblocks open the "make_shared_object.hpp" and show -> See the image please.




Thanks. I expected an answer! ;)

Alan Antonuk

unread,
Nov 15, 2016, 12:49:11 PM11/15/16
to Ruben Ferreira, simpleamqpclient-users
Be sure to look at the whole error message.  The key part of the message is "undefined reference to `AmqpClient::Channel::Channel`, which is defined in the library.

Make sure that you also link against the SimpleAmqpClient library when building your executable.

-Alan

--
You received this message because you are subscribed to the Google Groups "simpleamqpclient-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simpleamqpclient-...@googlegroups.com.
To post to this group, send email to simpleamqpc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simpleamqpclient-users/652b21dc-dca4-4db5-97a3-63b951dfacdb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruben Ferreira

unread,
Nov 16, 2016, 3:39:49 AM11/16/16
to simpleamqpclient-users
Hi. Thanks for the reply.

Ok, now i undertstand the error. But i try to compile (in command line) but i dont have success.

command example (in folder of my project in code blocks):

g++ -o test main.cpp -L -> befere -L i try some files in folder that i create to run cmake and make install (for example libSimpleAmqClient.pc, libSimpleAmqClient.so, libSimpleAmqClient.so.2, etc).. but i dont have sucesse, i got the same message error. I am a little new in Amqp and i still didn't understand how to use this library.

I will waiting a response, thanks once again! :)

Em terça-feira, 15 de novembro de 2016 17:49:11 UTC, Alan Antonuk escreveu:
Be sure to look at the whole error message.  The key part of the message is "undefined reference to `AmqpClient::Channel::Channel`, which is defined in the library.

Make sure that you also link against the SimpleAmqpClient library when building your executable.

-Alan

On Tue, Nov 15, 2016 at 12:33 AM Ruben Ferreira <rubenffe...@gmail.com> wrote:

hi :)


I try this library but i have the follow error:


"obj/Debug/main.o: In function `boost::detail::sp_if_not_arrayAmqpClient::Channel::type boost::make_shared<AmqpClient::Channel, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int&>(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int&)':"


My main class only have this line (as in the example)


AmqpClient::Channel::ptr_t connection = AmqpClient::Channel::Create("localhost");


I dont understand the error. This error appear when i try to build the code in codeblocks. I have the SimplesAmqpClient.h include and not appear any error before i build the code.


I use this library (SimpleAmqpClient), rabbitmq-c-0.8.0 and Ubuntu 16.04.1 LTS.


It is important to refer when this error occurs, the codeblocks open the "make_shared_object.hpp" and show -> See the image please.




Thanks. I expected an answer! ;)

--
You received this message because you are subscribed to the Google Groups "simpleamqpclient-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simpleamqpclient-users+unsub...@googlegroups.com.

Ruben Ferreira

unread,
Nov 16, 2016, 3:45:21 AM11/16/16
to simpleamqpclient-users
I have other question... how i install the c library rabbitmq-c-0.8.0? Use cmake and make install in the same folder simpleamqpclient-build ?

thanks

Ruben Ferreira

unread,
Nov 16, 2016, 1:13:17 PM11/16/16
to simpleamqpclient-users

Hi again... i have some news to explain the error.. I try to compile with this command line... i dont understand how to compile my main.cpp... I will waiting a response..thanks a lot again :)


Alan Antonuk

unread,
Nov 19, 2016, 5:49:35 PM11/19/16
to Ruben Ferreira, simpleamqpclient-users
You also need to link against rabbitmq-c.  If its installed in the same place as SimpleAmqpClient, you just need to add -lrabbitmq to the end of your command-line.

-Alan

On Wed, Nov 16, 2016 at 10:13 AM Ruben Ferreira <rubenffe...@gmail.com> wrote:

Hi again... i have some news to explain the error.. I try to compile with this command line... i dont understand how to compile my main.cpp... I will waiting a response..thanks a lot again :)


--
You received this message because you are subscribed to the Google Groups "simpleamqpclient-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simpleamqpclient-...@googlegroups.com.

To post to this group, send email to simpleamqpc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages