Hi,
Anybody ever met such "undefined reference" when using SimpleAmqpClient ?
I've tried to compile mytest.cpp
with x86_64-w64-mingw32-g++
. Below errors occurred. Actually I've already specified the path to where the SimpleAmqpClient library is with "-L" flag.
$ x86_64-w64-mingw32-g++ -static -static-libgcc -static-libstdc++ -Wl,-Bstatic -lpthread -Wl,-Bdynamic -Wno-deprecated -I/usr/local/include -I/usr/local/include/SimpleAmqpClient -L/usr/local/lib -L/usr/local/lib/pkgconfig -L/usr/x86_64-w64-mingw32/lib -L/usr/lib/gcc/x86_64-w64-mingw32/4.8 -std=gnu++11 -o mytest.out mytest.cpp -lSimpleAmqpClient
/tmp/ccUpsgSe.o:mytest.cpp:(.text+0xc90): undefined reference to `__imp__ZN10AmqpClient7Channel12DeclareQueueERKSsbbbb'
/tmp/ccUpsgSe.o:mytest.cpp:(.text+0xd0d): undefined reference to `__imp__ZN10AmqpClient12BasicMessage7ReplyToERKSs'
/tmp/ccUpsgSe.o:mytest.cpp:(.text+0xd6d): undefined reference to `__imp__ZN10AmqpClient7Channel12BasicPublishERKSsS2_N5boost10shared_ptrINS_12BasicMessageEEEbb'
/tmp/ccUpsgSe.o:mytest.cpp:(.text+0xe0c): undefined reference to `__imp__ZN10AmqpClient7Channel12BasicConsumeERKSsS2_bbbt'
/tmp/ccUpsgSe.o:mytest.cpp:(.text+0xe5a): undefined reference to `__imp__ZN10AmqpClient7Channel19BasicConsumeMessageERKSs'
/tmp/ccUpsgSe.o:mytest.cpp:(.text+0xea5): undefined reference to `__imp__ZNK10AmqpClient12BasicMessage4BodyEv'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/ccUpsgSe.o: bad reloc address 0x2c in section `.rdata'
collect2: error: ld returned 1 exit status
$ ls /usr/local/lib | grep Simple
libSimpleAmqpClient.a
libSimpleAmqpClient.so
libSimpleAmqpClient.so.2
libSimpleAmqpClient.so.2.4.0
Part of mytest.cpp
is as below,
#include <iostream>
#include <fstream>
#include <ostream>
#include <strstream>
#include "SimpleAmqpClient/SimpleAmqpClient.h"
.......
std::string dama_upload(......) {
// set up a channel to amqp
AmqpClient::Channel::ptr_t channel = AmqpClient::Channel::Create(host, port,
username, password,
vhost);
// declare a unique callback queue
const std::string callback_queue = channel->DeclareQueue("");
........
}
I've tried several ways after searching Google. But none of the solutions worked.
I guess it is the linker issue. But still cannot find out a way to solve this problem.
--
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/55334677-22d7-47f2-9c25-6319207c5931%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to simpleamqpclient-users+unsub...@googlegroups.com.
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/55334677-22d7-47f2-9c25-6319207c5931%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/9f1bd77d-f22f-40ca-bc72-819236e2bc61%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to simpleamqpclient-users+unsub...@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/55334677-22d7-47f2-9c25-6319207c5931%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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.