activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Libraries to include while compiling my activemq-cpp code
Date Mon, 27 Apr 2009 15:29:53 GMT
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/




Mime
View raw message