You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by manua <ag...@gmail.com> on 2009/04/24 21:45:33 UTC

Libraries to include while compiling my activemq-cpp code

Hi All,

I am writing my own producer and consumer code, but getting issues when
compiling my code. If I refer my cpp files in Makefile.am in the same format
as the example code, able to compile my code with make check. Kindly tell me
which libraries to include while compiling my own code.

Thanks,
Manu

-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23223505.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


nmittal wrote:
> 
> 
> 
>> It looks like its not using the correct version of APR, which is odd.
>> The `apr_pool_create_unmanaged_ex' didn't exist until APR 1.3 so if
>> that's not being found then it seems as if you are getting an old APR.
>> Have you tried linking against the APR .so files you built instead of
>> the libtool .la files.
>> 
>> Regards
>> Tim.
>> 
> 
> I changed the Makefile to...
> 
> ifeq ($(UNAME), Linux)
> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> -I/RSIGrid/amq/apr-1.3.3/include -c
> LDFLAGS      = -L/usr/local/lib -L/usr/local/apr/lib
> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
> CC_OUTPUT_FLAG = -o
> CC = g++
> LDLIBS = -lpthread -lactivemq-cpp -lapr-1 -laprutil-1 -luuid -lrt -lcrypt 
> -lpthread -ldl
> endif
> 
> and it built successfully. However, when I try to execute the binary, I
> get the following error...
> 
> $ ./register_ticker 
> ./register_ticker: error while loading shared libraries:
> libactivemq-cpp.so.7: cannot open shared object file: No such file or
> directory
> $
> 
> thanks again for your help.
> Nishant
> 
> 
> 

As you can see below that the file is there..

# ls -l /usr/local/lib/libactivemq-cpp.*
-rw-r--r-- 1 root root 94597380 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.a
-rwxr-xr-x 1 root root      980 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.la
lrwxrwxrwx 1 root root       24 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.so -> libactivemq-cpp.so.7.0.0
lrwxrwxrwx 1 root root       24 Mar 18 13:19
/usr/local/lib/libactivemq-cpp.so.6 -> libactivemq-cpp.so.6.0.1
-rwxr-xr-x 1 root root 33210789 Mar 18 13:19
/usr/local/lib/libactivemq-cpp.so.6.0.1
lrwxrwxrwx 1 root root       24 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.so.7 -> libactivemq-cpp.so.7.0.0
-rwxr-xr-x 1 root root 33312073 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.so.7.0.0
#

-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23224966.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Wed, 2009-04-29 at 04:47 -0700, nmittal wrote:
> 
> 
> Timothy Bish wrote:
> > 
> > On Tue, 2009-04-28 at 08:35 -0700, nmittal wrote:
> >> 
> >> 
> >> Timothy Bish wrote:
> >> > 
> >> > 
> >> > It still appears if your environment is working against you.  You need
> >> > to spend some time figuring out what is installed and where.
> >> > 
> >> >> /usr/bin/ld: skipping incompatible /usr/lib/libuuid.so when searching
> >> >> for -luuid
> >> > 
> >> > This error usually means that you don't have the right type of lib
> >> > installed, since you are building 64bit you might want to check that
> >> you
> >> > have a 64but version of this library installed.
> >> > 
> >> > You can start tracking what you have installed and also see what the
> >> > linker is going to find by using the locate command:
> >> > 
> >> > locate uuid.so
> >> > locate apr-1.so
> >> > locate aprutil-1.so
> >> > 
> >> > etc, etc.
> >> > 
> >> > wheneever you see "undefined symbol: apr_pool_create_unmanaged_ex" you
> >> > can be pretty sure that you are getting a version of APR older than 1.3
> >> > loaded from somewhere.
> >> > 
> >> > Regards
> >> > Tim.
> >> > -- 
> >> > Tim Bish
> >> > http://fusesource.com
> >> > http://timbish.blogspot.com/
> >> > 
> >> 
> >> Tim, I reinstalled all required libraries and i include them specifically
> >> in
> >> my Makefile now...
> >> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
> >> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> >> -I/usr/include/apr-1 -c
> >> LDFLAGS      = -L/usr/lib/libactivemq-cpp.so -L/usr/lib64/libuuid.so
> >> -L/usr/lib/libapr-1.so -L/usr/lib/libaprutil-1.so
> >> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
> >> CC_OUTPUT_FLAG = -o
> >> CC = g++
> >> LDLIBS = -lpthread -lrt -lcrypt -ldl
> >> 
> >> I built the ActiveMQ-CPP library again using the following options
> >> #./configure --with-apr=/usr/bin/apr-1-config
> >> --with-apr-util=/usr/bin/apu-1-config --prefix=/usr
> >> #make
> >> #make install
> >> # /usr/bin/activemqcpp-config --version
> >> 2.2.5
> >> # /usr/bin/activemqcpp-config --libs
> >> -lactivemq-cpp
> >> # /usr/bin/activemqcpp-config --includes
> >> -I/usr/include/activemq-cpp-2.2.5
> >> # /usr/bin/activemqcpp-config --prefix
> >> /usr
> >> # /usr/bin/activemqcpp-config --exec-prefix
> >> /usr
> >> # /usr/bin/activemqcpp-config --libs
> >> -lactivemq-cpp
> >> # /usr/bin/activemqcpp-config --cflags
> >> -I/usr/include/activemq-cpp-2.2.5
> >> 
> >> Now when I try to build my code, I get this error....
> >> 
> >> $ make
> >> make: Warning: File `Makefile' has modification time 81 s in the future
> >> g++ -pipe -fPIC -O3 -m64 -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> >> -I/usr/include/apr-1 -c -o RegisterTicker.o RegisterTicker.cpp
> >> g++ -pipe -fPIC -O3 -m64 -L/usr/lib/libactivemq-cpp.so
> >> -L/usr/lib64/libuuid.so -L/usr/lib/libapr-1.so -L/usr/lib/libaprutil-1.so
> >> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64   -o
> >> /RSIGrid/register_ticker RegisterTicker.o -lpthread -lrt -lcrypt -ldl
> >> RegisterTicker.o: In function `SimpleAsyncConsumer::runConsumer()':
> >> RegisterTicker.cpp:(.text+0x497): undefined reference to
> >> `activemq::core::ActiveMQConnectionFactory::ActiveMQConnectionFactory(std::basic_string<char,
> >> std::char_traits<char>, std::allocator<char> > const&,
> >> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> >> const&, std::basic_string<char, std::char_traits<char>,
> >> std::allocator<char>
> >> > const&)'
> >> collect2: ld returned 1 exit status
> >> make: *** [/RSIGrid/register_ticker] Error 1
> >> $
> >> 
> > 
> > Is it possible you are building 32bit versions of APR and AMQCPP, I ask
> > since they are installed in /usr/lib apparently and on your system I
> > would expect them in /usr/lib64 ?
> > 
> > 
> > -- 
> > Tim Bish
> > http://fusesource.com
> > http://timbish.blogspot.com/
> > 
> > 
> 
> Tim, I was able to make it work by linking the apr libs statically in my
> build. I am still not sure why the .so wouldnt work.
> 
> I appreciate all your help on this.
> 
> regards,
> Nishant
> 

Great, glad to hear that its working.  If you discover anything about
the reason you couldn't link to the shared library please report back.

-Tim


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


Timothy Bish wrote:
> 
> On Tue, 2009-04-28 at 08:35 -0700, nmittal wrote:
>> 
>> 
>> Timothy Bish wrote:
>> > 
>> > 
>> > It still appears if your environment is working against you.  You need
>> > to spend some time figuring out what is installed and where.
>> > 
>> >> /usr/bin/ld: skipping incompatible /usr/lib/libuuid.so when searching
>> >> for -luuid
>> > 
>> > This error usually means that you don't have the right type of lib
>> > installed, since you are building 64bit you might want to check that
>> you
>> > have a 64but version of this library installed.
>> > 
>> > You can start tracking what you have installed and also see what the
>> > linker is going to find by using the locate command:
>> > 
>> > locate uuid.so
>> > locate apr-1.so
>> > locate aprutil-1.so
>> > 
>> > etc, etc.
>> > 
>> > wheneever you see "undefined symbol: apr_pool_create_unmanaged_ex" you
>> > can be pretty sure that you are getting a version of APR older than 1.3
>> > loaded from somewhere.
>> > 
>> > Regards
>> > Tim.
>> > -- 
>> > Tim Bish
>> > http://fusesource.com
>> > http://timbish.blogspot.com/
>> > 
>> 
>> Tim, I reinstalled all required libraries and i include them specifically
>> in
>> my Makefile now...
>> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
>> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
>> -I/usr/include/apr-1 -c
>> LDFLAGS      = -L/usr/lib/libactivemq-cpp.so -L/usr/lib64/libuuid.so
>> -L/usr/lib/libapr-1.so -L/usr/lib/libaprutil-1.so
>> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
>> CC_OUTPUT_FLAG = -o
>> CC = g++
>> LDLIBS = -lpthread -lrt -lcrypt -ldl
>> 
>> I built the ActiveMQ-CPP library again using the following options
>> #./configure --with-apr=/usr/bin/apr-1-config
>> --with-apr-util=/usr/bin/apu-1-config --prefix=/usr
>> #make
>> #make install
>> # /usr/bin/activemqcpp-config --version
>> 2.2.5
>> # /usr/bin/activemqcpp-config --libs
>> -lactivemq-cpp
>> # /usr/bin/activemqcpp-config --includes
>> -I/usr/include/activemq-cpp-2.2.5
>> # /usr/bin/activemqcpp-config --prefix
>> /usr
>> # /usr/bin/activemqcpp-config --exec-prefix
>> /usr
>> # /usr/bin/activemqcpp-config --libs
>> -lactivemq-cpp
>> # /usr/bin/activemqcpp-config --cflags
>> -I/usr/include/activemq-cpp-2.2.5
>> 
>> Now when I try to build my code, I get this error....
>> 
>> $ make
>> make: Warning: File `Makefile' has modification time 81 s in the future
>> g++ -pipe -fPIC -O3 -m64 -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
>> -I/usr/include/apr-1 -c -o RegisterTicker.o RegisterTicker.cpp
>> g++ -pipe -fPIC -O3 -m64 -L/usr/lib/libactivemq-cpp.so
>> -L/usr/lib64/libuuid.so -L/usr/lib/libapr-1.so -L/usr/lib/libaprutil-1.so
>> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64   -o
>> /RSIGrid/register_ticker RegisterTicker.o -lpthread -lrt -lcrypt -ldl
>> RegisterTicker.o: In function `SimpleAsyncConsumer::runConsumer()':
>> RegisterTicker.cpp:(.text+0x497): undefined reference to
>> `activemq::core::ActiveMQConnectionFactory::ActiveMQConnectionFactory(std::basic_string<char,
>> std::char_traits<char>, std::allocator<char> > const&,
>> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>> const&, std::basic_string<char, std::char_traits<char>,
>> std::allocator<char>
>> > const&)'
>> collect2: ld returned 1 exit status
>> make: *** [/RSIGrid/register_ticker] Error 1
>> $
>> 
> 
> Is it possible you are building 32bit versions of APR and AMQCPP, I ask
> since they are installed in /usr/lib apparently and on your system I
> would expect them in /usr/lib64 ?
> 
> 
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 
> 

Tim, I was able to make it work by linking the apr libs statically in my
build. I am still not sure why the .so wouldnt work.

I appreciate all your help on this.

regards,
Nishant

-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23295687.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Tue, 2009-04-28 at 08:35 -0700, nmittal wrote:
> 
> 
> Timothy Bish wrote:
> > 
> > 
> > It still appears if your environment is working against you.  You need
> > to spend some time figuring out what is installed and where.
> > 
> >> /usr/bin/ld: skipping incompatible /usr/lib/libuuid.so when searching
> >> for -luuid
> > 
> > This error usually means that you don't have the right type of lib
> > installed, since you are building 64bit you might want to check that you
> > have a 64but version of this library installed.
> > 
> > You can start tracking what you have installed and also see what the
> > linker is going to find by using the locate command:
> > 
> > locate uuid.so
> > locate apr-1.so
> > locate aprutil-1.so
> > 
> > etc, etc.
> > 
> > wheneever you see "undefined symbol: apr_pool_create_unmanaged_ex" you
> > can be pretty sure that you are getting a version of APR older than 1.3
> > loaded from somewhere.
> > 
> > Regards
> > Tim.
> > -- 
> > Tim Bish
> > http://fusesource.com
> > http://timbish.blogspot.com/
> > 
> 
> Tim, I reinstalled all required libraries and i include them specifically in
> my Makefile now...
> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> -I/usr/include/apr-1 -c
> LDFLAGS      = -L/usr/lib/libactivemq-cpp.so -L/usr/lib64/libuuid.so
> -L/usr/lib/libapr-1.so -L/usr/lib/libaprutil-1.so
> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
> CC_OUTPUT_FLAG = -o
> CC = g++
> LDLIBS = -lpthread -lrt -lcrypt -ldl
> 
> I built the ActiveMQ-CPP library again using the following options
> #./configure --with-apr=/usr/bin/apr-1-config
> --with-apr-util=/usr/bin/apu-1-config --prefix=/usr
> #make
> #make install
> # /usr/bin/activemqcpp-config --version
> 2.2.5
> # /usr/bin/activemqcpp-config --libs
> -lactivemq-cpp
> # /usr/bin/activemqcpp-config --includes
> -I/usr/include/activemq-cpp-2.2.5
> # /usr/bin/activemqcpp-config --prefix
> /usr
> # /usr/bin/activemqcpp-config --exec-prefix
> /usr
> # /usr/bin/activemqcpp-config --libs
> -lactivemq-cpp
> # /usr/bin/activemqcpp-config --cflags
> -I/usr/include/activemq-cpp-2.2.5
> 
> Now when I try to build my code, I get this error....
> 
> $ make
> make: Warning: File `Makefile' has modification time 81 s in the future
> g++ -pipe -fPIC -O3 -m64 -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> -I/usr/include/apr-1 -c -o RegisterTicker.o RegisterTicker.cpp
> g++ -pipe -fPIC -O3 -m64 -L/usr/lib/libactivemq-cpp.so
> -L/usr/lib64/libuuid.so -L/usr/lib/libapr-1.so -L/usr/lib/libaprutil-1.so
> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64   -o
> /RSIGrid/register_ticker RegisterTicker.o -lpthread -lrt -lcrypt -ldl
> RegisterTicker.o: In function `SimpleAsyncConsumer::runConsumer()':
> RegisterTicker.cpp:(.text+0x497): undefined reference to
> `activemq::core::ActiveMQConnectionFactory::ActiveMQConnectionFactory(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> const&, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> > const&)'
> collect2: ld returned 1 exit status
> make: *** [/RSIGrid/register_ticker] Error 1
> $
> 

Is it possible you are building 32bit versions of APR and AMQCPP, I ask
since they are installed in /usr/lib apparently and on your system I
would expect them in /usr/lib64 ?


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


Timothy Bish wrote:
> 
> 
> It still appears if your environment is working against you.  You need
> to spend some time figuring out what is installed and where.
> 
>> /usr/bin/ld: skipping incompatible /usr/lib/libuuid.so when searching
>> for -luuid
> 
> This error usually means that you don't have the right type of lib
> installed, since you are building 64bit you might want to check that you
> have a 64but version of this library installed.
> 
> You can start tracking what you have installed and also see what the
> linker is going to find by using the locate command:
> 
> locate uuid.so
> locate apr-1.so
> locate aprutil-1.so
> 
> etc, etc.
> 
> wheneever you see "undefined symbol: apr_pool_create_unmanaged_ex" you
> can be pretty sure that you are getting a version of APR older than 1.3
> loaded from somewhere.
> 
> Regards
> Tim.
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 

Tim, I reinstalled all required libraries and i include them specifically in
my Makefile now...
CPPLDFLAGS   = -pipe -fPIC -O3 -m64
CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
-I/usr/include/apr-1 -c
LDFLAGS      = -L/usr/lib/libactivemq-cpp.so -L/usr/lib64/libuuid.so
-L/usr/lib/libapr-1.so -L/usr/lib/libaprutil-1.so
-L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
CC_OUTPUT_FLAG = -o
CC = g++
LDLIBS = -lpthread -lrt -lcrypt -ldl

I built the ActiveMQ-CPP library again using the following options
#./configure --with-apr=/usr/bin/apr-1-config
--with-apr-util=/usr/bin/apu-1-config --prefix=/usr
#make
#make install
# /usr/bin/activemqcpp-config --version
2.2.5
# /usr/bin/activemqcpp-config --libs
-lactivemq-cpp
# /usr/bin/activemqcpp-config --includes
-I/usr/include/activemq-cpp-2.2.5
# /usr/bin/activemqcpp-config --prefix
/usr
# /usr/bin/activemqcpp-config --exec-prefix
/usr
# /usr/bin/activemqcpp-config --libs
-lactivemq-cpp
# /usr/bin/activemqcpp-config --cflags
-I/usr/include/activemq-cpp-2.2.5

Now when I try to build my code, I get this error....

$ make
make: Warning: File `Makefile' has modification time 81 s in the future
g++ -pipe -fPIC -O3 -m64 -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
-I/usr/include/apr-1 -c -o RegisterTicker.o RegisterTicker.cpp
g++ -pipe -fPIC -O3 -m64 -L/usr/lib/libactivemq-cpp.so
-L/usr/lib64/libuuid.so -L/usr/lib/libapr-1.so -L/usr/lib/libaprutil-1.so
-L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64   -o
/RSIGrid/register_ticker RegisterTicker.o -lpthread -lrt -lcrypt -ldl
RegisterTicker.o: In function `SimpleAsyncConsumer::runConsumer()':
RegisterTicker.cpp:(.text+0x497): undefined reference to
`activemq::core::ActiveMQConnectionFactory::ActiveMQConnectionFactory(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> const&)'
collect2: ld returned 1 exit status
make: *** [/RSIGrid/register_ticker] Error 1
$



-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23279598.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2009-04-27 at 13:09 -0700, nmittal wrote:
> 
> 
> Timothy Bish wrote:
> > 
> > On Mon, 2009-04-27 at 09:38 -0700, nmittal wrote:
> > 
> > Most autoconf based packages install in /usr/local by default unless you
> > pass the prefix argument to the configure script.
> > 
> > Try './configure --prefix=/usr'
> > 
> > Reading the configure scripts help output can be helpful
> > './configure --help'
> > 
> > Regards
> > Tim.
> > 
> > -- 
> > Tim Bish
> > http://fusesource.com
> > http://timbish.blogspot.com/
> > 
> > 
> 
> Tim, thanks again.
> I have installed apr-util-1.3.4 and apr-1.3.3
> # apu-1-config --version
> 1.3.4
> # apr-1-config --version
> 1.3.3
> #
> 
> I re-built and installed Activemq-cpp again.
> 
> -rw-r--r-- 1 root root 94597276 Apr 27 15:53
> /usr/local/lib/libactivemq-cpp.a
> -rwxr-xr-x 1 root root      952 Apr 27 15:53
> /usr/local/lib/libactivemq-cpp.la
> lrwxrwxrwx 1 root root       24 Apr 27 15:53
> /usr/local/lib/libactivemq-cpp.so -> libactivemq-cpp.so.7.0.0
> lrwxrwxrwx 1 root root       24 Mar 18 13:19
> /usr/local/lib/libactivemq-cpp.so.6 -> libactivemq-cpp.so.6.0.1
> -rwxr-xr-x 1 root root 33210789 Mar 18 13:19
> /usr/local/lib/libactivemq-cpp.so.6.0.1
> lrwxrwxrwx 1 root root       24 Apr 27 15:53
> /usr/local/lib/libactivemq-cpp.so.7 -> libactivemq-cpp.so.7.0.0
> -rwxr-xr-x 1 root root 33311937 Apr 27 15:53
> /usr/local/lib/libactivemq-cpp.so.7.0.0
> lrwxrwxrwx 1 root root       24 Mar 18 12:17
> /usr/local/lib/libcppunit-1.12.so.1 -> libcppunit-1.12.so.1.0.0
> -rwxr-xr-x 1 root root  2450989 Mar 18 12:17
> /usr/local/lib/libcppunit-1.12.so.1.0.0
> -rw-r--r-- 1 root root  5772290 Mar 18 12:17 /usr/local/lib/libcppunit.a
> -rwxr-xr-x 1 root root      844 Mar 18 12:17 /usr/local/lib/libcppunit.la
> lrwxrwxrwx 1 root root       24 Mar 18 12:17 /usr/local/lib/libcppunit.so ->
> libcppunit-1.12.so.1.0.0
> 
> I have changed my Makefile to..
> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> -I/RSIGrid/amq/apr-1.3.3/include -c
> LDFLAGS      = -L/usr/lib
> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64
> CC_OUTPUT_FLAG = -o
> CC = g++
> LDLIBS = -lpthread -lactivemq-cpp -lapr-1 -laprutil-1 -luuid -lrt -lcrypt 
> -lpthread -ldl
> 
> however, when i build my code I get this...
> g++ -pipe -fPIC -O3 -m64 -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> -I/usr/include/apr-1 -c -o RegisterTicker.o RegisterTicker.cpp
> g++ -pipe -fPIC -O3 -m64 -L/usr/local/lib -L/usr/lib
> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64   -o
> /RSIGrid/register_ticker RegisterTicker.o -lpthread -lactivemq-cpp -lapr-1
> -laprutil-1 -luuid -lrt -lcrypt  -lpthread -ldl
> /usr/bin/ld: skipping incompatible /usr/lib/libuuid.so when searching for
> -luuid
> /usr/bin/ld: skipping incompatible /usr/lib/libuuid.a when searching for
> -luuid
> 
> it builds fine but when I try to run the executable i get...
> $ ./register_ticker 
> ./register_ticker: symbol lookup error: /usr/local/lib/libactivemq-cpp.so.7:
> undefined symbol: apr_pool_create_unmanaged_ex
> $
> 
> also my LD_LIBRARY_PATH is...
> $ echo $LD_LIBRARY_PATH 
> /usr/lib64:/usr/local/BerkeleyDB.4.7/lib:/usr/lib:/usr/local/lib
> 
> I have no clue what I am doing wrong.. please help.
> 
> 
> 
> 

It still appears if your environment is working against you.  You need
to spend some time figuring out what is installed and where.

> /usr/bin/ld: skipping incompatible /usr/lib/libuuid.so when searching
> for -luuid

This error usually means that you don't have the right type of lib
installed, since you are building 64bit you might want to check that you
have a 64but version of this library installed.

You can start tracking what you have installed and also see what the
linker is going to find by using the locate command:

locate uuid.so
locate apr-1.so
locate aprutil-1.so

etc, etc.

wheneever you see "undefined symbol: apr_pool_create_unmanaged_ex" you
can be pretty sure that you are getting a version of APR older than 1.3
loaded from somewhere.

Regards
Tim.




-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


Timothy Bish wrote:
> 
> On Mon, 2009-04-27 at 09:38 -0700, nmittal wrote:
> 
> Most autoconf based packages install in /usr/local by default unless you
> pass the prefix argument to the configure script.
> 
> Try './configure --prefix=/usr'
> 
> Reading the configure scripts help output can be helpful
> './configure --help'
> 
> Regards
> Tim.
> 
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 
> 

Tim, thanks again.
I have installed apr-util-1.3.4 and apr-1.3.3
# apu-1-config --version
1.3.4
# apr-1-config --version
1.3.3
#

I re-built and installed Activemq-cpp again.

-rw-r--r-- 1 root root 94597276 Apr 27 15:53
/usr/local/lib/libactivemq-cpp.a
-rwxr-xr-x 1 root root      952 Apr 27 15:53
/usr/local/lib/libactivemq-cpp.la
lrwxrwxrwx 1 root root       24 Apr 27 15:53
/usr/local/lib/libactivemq-cpp.so -> libactivemq-cpp.so.7.0.0
lrwxrwxrwx 1 root root       24 Mar 18 13:19
/usr/local/lib/libactivemq-cpp.so.6 -> libactivemq-cpp.so.6.0.1
-rwxr-xr-x 1 root root 33210789 Mar 18 13:19
/usr/local/lib/libactivemq-cpp.so.6.0.1
lrwxrwxrwx 1 root root       24 Apr 27 15:53
/usr/local/lib/libactivemq-cpp.so.7 -> libactivemq-cpp.so.7.0.0
-rwxr-xr-x 1 root root 33311937 Apr 27 15:53
/usr/local/lib/libactivemq-cpp.so.7.0.0
lrwxrwxrwx 1 root root       24 Mar 18 12:17
/usr/local/lib/libcppunit-1.12.so.1 -> libcppunit-1.12.so.1.0.0
-rwxr-xr-x 1 root root  2450989 Mar 18 12:17
/usr/local/lib/libcppunit-1.12.so.1.0.0
-rw-r--r-- 1 root root  5772290 Mar 18 12:17 /usr/local/lib/libcppunit.a
-rwxr-xr-x 1 root root      844 Mar 18 12:17 /usr/local/lib/libcppunit.la
lrwxrwxrwx 1 root root       24 Mar 18 12:17 /usr/local/lib/libcppunit.so ->
libcppunit-1.12.so.1.0.0

I have changed my Makefile to..
CPPLDFLAGS   = -pipe -fPIC -O3 -m64
CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
-I/RSIGrid/amq/apr-1.3.3/include -c
LDFLAGS      = -L/usr/lib
-L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64
CC_OUTPUT_FLAG = -o
CC = g++
LDLIBS = -lpthread -lactivemq-cpp -lapr-1 -laprutil-1 -luuid -lrt -lcrypt 
-lpthread -ldl

however, when i build my code I get this...
g++ -pipe -fPIC -O3 -m64 -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
-I/usr/include/apr-1 -c -o RegisterTicker.o RegisterTicker.cpp
g++ -pipe -fPIC -O3 -m64 -L/usr/local/lib -L/usr/lib
-L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64   -o
/RSIGrid/register_ticker RegisterTicker.o -lpthread -lactivemq-cpp -lapr-1
-laprutil-1 -luuid -lrt -lcrypt  -lpthread -ldl
/usr/bin/ld: skipping incompatible /usr/lib/libuuid.so when searching for
-luuid
/usr/bin/ld: skipping incompatible /usr/lib/libuuid.a when searching for
-luuid

it builds fine but when I try to run the executable i get...
$ ./register_ticker 
./register_ticker: symbol lookup error: /usr/local/lib/libactivemq-cpp.so.7:
undefined symbol: apr_pool_create_unmanaged_ex
$

also my LD_LIBRARY_PATH is...
$ echo $LD_LIBRARY_PATH 
/usr/lib64:/usr/local/BerkeleyDB.4.7/lib:/usr/lib:/usr/local/lib

I have no clue what I am doing wrong.. please help.




-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23263959.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2009-04-27 at 09:38 -0700, nmittal wrote:
> 
> 
> Timothy Bish wrote:
> > 
> > On Mon, 2009-04-27 at 08:35 -0700, nmittal wrote:
> > 
> > 
> > You apparently have v1.2.7.  You can usually find out the version by
> > using the config script installed with APR 'apr-1-config --version' will
> > tell you.  You can find out where its installed by 'which apr-1-config'
> > 
> > 
> > -- 
> > Tim Bish
> > http://fusesource.com
> > http://timbish.blogspot.com/
> > 
> 
> Tim, you are right. 
> # which apr-1-config 
> /usr/bin/apr-1-config
> # apr-1-config --version
> 1.2.7
> #
> 
> however, even after ./configure, make, make test, make install of apr-1.3.3
> i get the same result
> # apr-1-config --version
> 1.2.7
> 
> apparantly when I installed from source it put the apr-1-config script in
> /usr/local/apr/bin/ instead of /usr/bin
> 
> do you know why that would be and how I can overwrite the previous install.
> 
> thanks

Most autoconf based packages install in /usr/local by default unless you
pass the prefix argument to the configure script.

Try './configure --prefix=/usr'

Reading the configure scripts help output can be helpful
'./configure --help'

Regards
Tim.



-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


Timothy Bish wrote:
> 
> On Mon, 2009-04-27 at 08:35 -0700, nmittal wrote:
> 
> 
> You apparently have v1.2.7.  You can usually find out the version by
> using the config script installed with APR 'apr-1-config --version' will
> tell you.  You can find out where its installed by 'which apr-1-config'
> 
> 
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 

Tim, you are right. 
# which apr-1-config 
/usr/bin/apr-1-config
# apr-1-config --version
1.2.7
#

however, even after ./configure, make, make test, make install of apr-1.3.3
i get the same result
# apr-1-config --version
1.2.7

apparantly when I installed from source it put the apr-1-config script in
/usr/local/apr/bin/ instead of /usr/bin

do you know why that would be and how I can overwrite the previous install.

thanks
-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23260230.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2009-04-27 at 08:35 -0700, nmittal wrote:
> 
> 
> Timothy Bish wrote:
> > 
> >>From problems you were having previously I'm assuming that you have an
> > older version of APR installed somewhere on Path and that is getting
> > found instead of the 1.3 version you built and installed in /usr/local
> > most likely in /usr/lib.  The best solution is to build and install APR
> > over the install that you currently have in /usr so that you don't have
> > to muck around with all these path changes to get the client to build
> > and run.  Barring that you need to alter your environment such that the
> > version of APR found first by the loader is the 1.3 version.
> > 
> > You can install an APR 1.3 over an older version of APR 1.x since the
> > APR version guidelines state that they are always backwards compatible
> > across major version numbers.
> > 
> > Regards
> > Tim.
> > 
> > 
> > -- 
> > Tim Bish
> > http://fusesource.com
> > http://timbish.blogspot.com/
> > 
> > 
> > 
> 
> I will do that.. is there a quick way to check what version is have on? this
> is a 64-bit server and yum install httpd-devel only puts the following...
> Installing:
>  httpd-devel         x86_64    2.2.3-22.el5      rhel-x86_64-server-5    148
> k
>  httpd-devel         i386      2.2.3-22.el5      rhel-x86_64-server-5    148
> k
> Installing for dependencies:
>  apr-devel           x86_64    1.2.7-11          rhel-x86_64-server-5    243
> k
>  apr-util-devel      x86_64    1.2.7-7.el5       rhel-x86_64-server-5     54
> k
>  cyrus-sasl-devel    x86_64    2.1.22-4          rhel-x86_64-server-5    1.4
> M
>  expat-devel         x86_64    1.95.8-8.2.1      rhel-x86_64-server-5    126
> k
>  httpd               x86_64    2.2.3-22.el5      rhel-x86_64-server-5    1.2
> M
>  openldap-devel      x86_64    2.3.43-3.el5      rhel-x86_64-server-5    1.6
> M
> 

You apparently have v1.2.7.  You can usually find out the version by
using the config script installed with APR 'apr-1-config --version' will
tell you.  You can find out where its installed by 'which apr-1-config'


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


Timothy Bish wrote:
> 
>>>From problems you were having previously I'm assuming that you have an
> older version of APR installed somewhere on Path and that is getting
> found instead of the 1.3 version you built and installed in /usr/local
> most likely in /usr/lib.  The best solution is to build and install APR
> over the install that you currently have in /usr so that you don't have
> to muck around with all these path changes to get the client to build
> and run.  Barring that you need to alter your environment such that the
> version of APR found first by the loader is the 1.3 version.
> 
> You can install an APR 1.3 over an older version of APR 1.x since the
> APR version guidelines state that they are always backwards compatible
> across major version numbers.
> 
> Regards
> Tim.
> 
> 
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 
> 
> 

I will do that.. is there a quick way to check what version is have on? this
is a 64-bit server and yum install httpd-devel only puts the following...
Installing:
 httpd-devel         x86_64    2.2.3-22.el5      rhel-x86_64-server-5    148
k
 httpd-devel         i386      2.2.3-22.el5      rhel-x86_64-server-5    148
k
Installing for dependencies:
 apr-devel           x86_64    1.2.7-11          rhel-x86_64-server-5    243
k
 apr-util-devel      x86_64    1.2.7-7.el5       rhel-x86_64-server-5     54
k
 cyrus-sasl-devel    x86_64    2.1.22-4          rhel-x86_64-server-5    1.4
M
 expat-devel         x86_64    1.95.8-8.2.1      rhel-x86_64-server-5    126
k
 httpd               x86_64    2.2.3-22.el5      rhel-x86_64-server-5    1.2
M
 openldap-devel      x86_64    2.3.43-3.el5      rhel-x86_64-server-5    1.6
M

-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23259011.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2009-04-27 at 08:17 -0700, nmittal wrote:
> 
> 
> Timothy Bish wrote:
> > 
> > On Fri, 2009-04-24 at 14:05 -0700, nmittal wrote:
> >> 
> >> 
> >> > It looks like its not using the correct version of APR, which is odd.
> >> > The `apr_pool_create_unmanaged_ex' didn't exist until APR 1.3 so if
> >> > that's not being found then it seems as if you are getting an old APR.
> >> > Have you tried linking against the APR .so files you built instead of
> >> > the libtool .la files.
> >> > 
> >> > Regards
> >> > Tim.
> >> > 
> >> 
> >> I changed the Makefile to...
> >> 
> >> ifeq ($(UNAME), Linux)
> >> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
> >> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> >> -I/RSIGrid/amq/apr-1.3.3/include -c
> >> LDFLAGS      = -L/usr/local/lib -L/usr/local/apr/lib
> >> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
> >> CC_OUTPUT_FLAG = -o
> >> CC = g++
> >> LDLIBS = -lpthread -lactivemq-cpp -lapr-1 -laprutil-1 -luuid -lrt -lcrypt 
> >> -lpthread -ldl
> >> endif
> >> 
> >> and it built successfully. However, when I try to execute the binary, I
> >> get
> >> the following error...
> >> 
> >> $ ./register_ticker 
> >> ./register_ticker: error while loading shared libraries:
> >> libactivemq-cpp.so.7: cannot open shared object file: No such file or
> >> directory
> >> $
> >> 
> >> thanks again for your help.
> >> Nishant
> >> 
> > 
> > Probably because its not sitting anywhere that is on the LD_LIBRARY_PATH
> > or in the ld.so.conf settings.  Either add its location so it can be
> > found at run time, or link to the static libs by using the .a files
> > instead of not specifying an extension as that result in the linker
> > choosing the shared library over the static one.
> > 
> > Regards
> > Tim.
> > 
> > -- 
> > Tim Bish
> > http://fusesource.com
> > http://timbish.blogspot.com/
> > 
> > 
> 
> Tim,
> I added the paths to all the libraries in my .bash_profile
> $ echo $LD_LIBRARY_PATH 
> /usr/local/lib:/usr/local/apr/lib
> $
> 
> but now when I run the executable, I get a different error...
> $ ./register_ticker 
> ./register_ticker: symbol lookup error: /usr/local/lib/libactivemq-cpp.so.7:
> undefined symbol: apr_pool_create_unmanaged_ex
> $ 
> 
> All the libs are there...
> $ ls -l /usr/local/lib/libactivemq-cpp.*
> -rw-r--r-- 1 root root 94597380 Apr 24 14:27
> /usr/local/lib/libactivemq-cpp.a
> -rwxr-xr-x 1 root root      980 Apr 24 14:27
> /usr/local/lib/libactivemq-cpp.la
> lrwxrwxrwx 1 root root       24 Apr 24 14:27
> /usr/local/lib/libactivemq-cpp.so -> libactivemq-cpp.so.7.0.0
> lrwxrwxrwx 1 root root       24 Mar 18 13:19
> /usr/local/lib/libactivemq-cpp.so.6 -> libactivemq-cpp.so.6.0.1
> -rwxr-xr-x 1 root root 33210789 Mar 18 13:19
> /usr/local/lib/libactivemq-cpp.so.6.0.1
> lrwxrwxrwx 1 root root       24 Apr 24 14:27
> /usr/local/lib/libactivemq-cpp.so.7 -> libactivemq-cpp.so.7.0.0
> -rwxr-xr-x 1 root root 33312073 Apr 24 14:27
> /usr/local/lib/libactivemq-cpp.so.7.0.0
> $ 
> 
> I dont know what I am missing. Please help.
> 
> thanks in advance.
> 
> Nishant
> 

>>From problems you were having previously I'm assuming that you have an
older version of APR installed somewhere on Path and that is getting
found instead of the 1.3 version you built and installed in /usr/local
most likely in /usr/lib.  The best solution is to build and install APR
over the install that you currently have in /usr so that you don't have
to muck around with all these path changes to get the client to build
and run.  Barring that you need to alter your environment such that the
version of APR found first by the loader is the 1.3 version.

You can install an APR 1.3 over an older version of APR 1.x since the
APR version guidelines state that they are always backwards compatible
across major version numbers.

Regards
Tim.


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


Timothy Bish wrote:
> 
> On Fri, 2009-04-24 at 14:05 -0700, nmittal wrote:
>> 
>> 
>> > It looks like its not using the correct version of APR, which is odd.
>> > The `apr_pool_create_unmanaged_ex' didn't exist until APR 1.3 so if
>> > that's not being found then it seems as if you are getting an old APR.
>> > Have you tried linking against the APR .so files you built instead of
>> > the libtool .la files.
>> > 
>> > Regards
>> > Tim.
>> > 
>> 
>> I changed the Makefile to...
>> 
>> ifeq ($(UNAME), Linux)
>> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
>> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
>> -I/RSIGrid/amq/apr-1.3.3/include -c
>> LDFLAGS      = -L/usr/local/lib -L/usr/local/apr/lib
>> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
>> CC_OUTPUT_FLAG = -o
>> CC = g++
>> LDLIBS = -lpthread -lactivemq-cpp -lapr-1 -laprutil-1 -luuid -lrt -lcrypt 
>> -lpthread -ldl
>> endif
>> 
>> and it built successfully. However, when I try to execute the binary, I
>> get
>> the following error...
>> 
>> $ ./register_ticker 
>> ./register_ticker: error while loading shared libraries:
>> libactivemq-cpp.so.7: cannot open shared object file: No such file or
>> directory
>> $
>> 
>> thanks again for your help.
>> Nishant
>> 
> 
> Probably because its not sitting anywhere that is on the LD_LIBRARY_PATH
> or in the ld.so.conf settings.  Either add its location so it can be
> found at run time, or link to the static libs by using the .a files
> instead of not specifying an extension as that result in the linker
> choosing the shared library over the static one.
> 
> Regards
> Tim.
> 
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 
> 

Tim,
I added the paths to all the libraries in my .bash_profile
$ echo $LD_LIBRARY_PATH 
/usr/local/lib:/usr/local/apr/lib
$

but now when I run the executable, I get a different error...
$ ./register_ticker 
./register_ticker: symbol lookup error: /usr/local/lib/libactivemq-cpp.so.7:
undefined symbol: apr_pool_create_unmanaged_ex
$ 

All the libs are there...
$ ls -l /usr/local/lib/libactivemq-cpp.*
-rw-r--r-- 1 root root 94597380 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.a
-rwxr-xr-x 1 root root      980 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.la
lrwxrwxrwx 1 root root       24 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.so -> libactivemq-cpp.so.7.0.0
lrwxrwxrwx 1 root root       24 Mar 18 13:19
/usr/local/lib/libactivemq-cpp.so.6 -> libactivemq-cpp.so.6.0.1
-rwxr-xr-x 1 root root 33210789 Mar 18 13:19
/usr/local/lib/libactivemq-cpp.so.6.0.1
lrwxrwxrwx 1 root root       24 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.so.7 -> libactivemq-cpp.so.7.0.0
-rwxr-xr-x 1 root root 33312073 Apr 24 14:27
/usr/local/lib/libactivemq-cpp.so.7.0.0
$ 

I dont know what I am missing. Please help.

thanks in advance.

Nishant

-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23258633.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2009-04-24 at 14:05 -0700, nmittal wrote:
> 
> 
> > It looks like its not using the correct version of APR, which is odd.
> > The `apr_pool_create_unmanaged_ex' didn't exist until APR 1.3 so if
> > that's not being found then it seems as if you are getting an old APR.
> > Have you tried linking against the APR .so files you built instead of
> > the libtool .la files.
> > 
> > Regards
> > Tim.
> > 
> 
> I changed the Makefile to...
> 
> ifeq ($(UNAME), Linux)
> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> -I/RSIGrid/amq/apr-1.3.3/include -c
> LDFLAGS      = -L/usr/local/lib -L/usr/local/apr/lib
> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
> CC_OUTPUT_FLAG = -o
> CC = g++
> LDLIBS = -lpthread -lactivemq-cpp -lapr-1 -laprutil-1 -luuid -lrt -lcrypt 
> -lpthread -ldl
> endif
> 
> and it built successfully. However, when I try to execute the binary, I get
> the following error...
> 
> $ ./register_ticker 
> ./register_ticker: error while loading shared libraries:
> libactivemq-cpp.so.7: cannot open shared object file: No such file or
> directory
> $
> 
> thanks again for your help.
> Nishant
> 

Probably because its not sitting anywhere that is on the LD_LIBRARY_PATH
or in the ld.so.conf settings.  Either add its location so it can be
found at run time, or link to the static libs by using the .a files
instead of not specifying an extension as that result in the linker
choosing the shared library over the static one.

Regards
Tim.

-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


> It looks like its not using the correct version of APR, which is odd.
> The `apr_pool_create_unmanaged_ex' didn't exist until APR 1.3 so if
> that's not being found then it seems as if you are getting an old APR.
> Have you tried linking against the APR .so files you built instead of
> the libtool .la files.
> 
> Regards
> Tim.
> 

I changed the Makefile to...

ifeq ($(UNAME), Linux)
CPPLDFLAGS   = -pipe -fPIC -O3 -m64
CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
-I/RSIGrid/amq/apr-1.3.3/include -c
LDFLAGS      = -L/usr/local/lib -L/usr/local/apr/lib
-L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
CC_OUTPUT_FLAG = -o
CC = g++
LDLIBS = -lpthread -lactivemq-cpp -lapr-1 -laprutil-1 -luuid -lrt -lcrypt 
-lpthread -ldl
endif

and it built successfully. However, when I try to execute the binary, I get
the following error...

$ ./register_ticker 
./register_ticker: error while loading shared libraries:
libactivemq-cpp.so.7: cannot open shared object file: No such file or
directory
$

thanks again for your help.
Nishant




-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23224881.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2009-04-24 at 13:52 -0700, nmittal wrote:
> 
> 
> Timothy Bish wrote:
> > 
> > Besides the activemq-cpp lib you need:
> > 
> > libapr-1
> > libaprutil-1
> > 
> > and whatever libs that the APR scripts tell you
> > apr-1-config --libs
> > apu-1-config --libs
> > 
> > Regards
> > Tim.
> > 
> > 
> > 
> 
> Tim thanks. My Makefile looks like this...
> ifeq ($(UNAME), Linux)
> CPPLDFLAGS   = -pipe -fPIC -O3 -m64
> CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
> -I/RSIGrid/amq/apr-1.3.3/include -c
> LDFLAGS      = -L/usr/local/lib -L/RSIGrid/amq/apr-1.3.3/libapr-1.la
> -L/RSIGrid/amq/apr-util-1.3.4/libaprutil-1.la
> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
> CC_OUTPUT_FLAG = -o
> CC = g++
> LDLIBS = -lactivemq-cpp -luuid -lrt -lcrypt  -lpthread -ldl
> endif
> 
> however when I try to make, i get...
> g++ -pipe -fPIC -O3 -m64 -L/usr/local/lib
> -L/RSIGrid/amq/apr-1.3.3/libapr-1.la
> -L/RSIGrid/amq/apr-util-1.3.4/libaprutil-1.la
> -L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64   -o
> /RSIGrid/register_ticker RegisterTicker.o -lpthread -lactivemq-cpp -luuid
> -lrt -lcrypt  -lpthread -ldl
> /usr/local/lib/libactivemq-cpp.so: undefined reference to
> `apr_pool_create_unmanaged_ex'
> collect2: ld returned 1 exit status
> make: *** [/RSIGrid/register_ticker] Error 1
> 
> 
> what am I missing. I appreciate any help on this.
> 
> thanks
> Nishant
> 
> 

It looks like its not using the correct version of APR, which is odd.
The `apr_pool_create_unmanaged_ex' didn't exist until APR 1.3 so if
that's not being found then it seems as if you are getting an old APR.
Have you tried linking against the APR .so files you built instead of
the libtool .la files.

Regards
Tim.




Re: Libraries to include while compiling my activemq-cpp code

Posted by nmittal <nm...@rblt.com>.


Timothy Bish wrote:
> 
> Besides the activemq-cpp lib you need:
> 
> libapr-1
> libaprutil-1
> 
> and whatever libs that the APR scripts tell you
> apr-1-config --libs
> apu-1-config --libs
> 
> Regards
> Tim.
> 
> 
> 

Tim thanks. My Makefile looks like this...
ifeq ($(UNAME), Linux)
CPPLDFLAGS   = -pipe -fPIC -O3 -m64
CPPFLAGS     = -I. -I/RSIGrid/amq/activemq-cpp-2.2.5/src/main
-I/RSIGrid/amq/apr-1.3.3/include -c
LDFLAGS      = -L/usr/local/lib -L/RSIGrid/amq/apr-1.3.3/libapr-1.la
-L/RSIGrid/amq/apr-util-1.3.4/libaprutil-1.la
-L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64  
CC_OUTPUT_FLAG = -o
CC = g++
LDLIBS = -lactivemq-cpp -luuid -lrt -lcrypt  -lpthread -ldl
endif

however when I try to make, i get...
g++ -pipe -fPIC -O3 -m64 -L/usr/local/lib
-L/RSIGrid/amq/apr-1.3.3/libapr-1.la
-L/RSIGrid/amq/apr-util-1.3.4/libaprutil-1.la
-L/RSIGrid/amq/apr-util-1.3.4/xml/expat/lib/libexpat.la -m64   -o
/RSIGrid/register_ticker RegisterTicker.o -lpthread -lactivemq-cpp -luuid
-lrt -lcrypt  -lpthread -ldl
/usr/local/lib/libactivemq-cpp.so: undefined reference to
`apr_pool_create_unmanaged_ex'
collect2: ld returned 1 exit status
make: *** [/RSIGrid/register_ticker] Error 1


what am I missing. I appreciate any help on this.

thanks
Nishant



-- 
View this message in context: http://www.nabble.com/Libraries-to-include-while-compiling-my-activemq-cpp-code-tp23223505p23224695.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Libraries to include while compiling my activemq-cpp code

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2009-04-24 at 12:45 -0700, manua wrote:
> Hi All,
> 
> I am writing my own producer and consumer code, but getting issues when
> compiling my code. If I refer my cpp files in Makefile.am in the same format
> as the example code, able to compile my code with make check. Kindly tell me
> which libraries to include while compiling my own code.
> 
> Thanks,
> Manu
> 

Besides the activemq-cpp lib you need:

libapr-1
libaprutil-1

and whatever libs that the APR scripts tell you
apr-1-config --libs
apu-1-config --libs

Regards
Tim.