You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by dongabda <do...@ikusi.es> on 2009/06/25 17:51:22 UTC

build activemqcpp embedding apr1/apr-util-1 static libraries (Linux)

How can I embed the libapr-1.a and libapr-util-1.a into libactivemqcpp.a? 

I've an application that uses activemq. I put the -lactivemq to the linker
flags but compiling it reports this errror: 

/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../libactivemq-cpp.a(libactivemq_cpp_la-Exception.o):
In function `decaf::lang::Exception::buildMessage(char const*, char*&)':
/home/activemqtest/Download/activemq-cpp-library-3.0/src/main/decaf/lang/Exception.cpp:93:
undefined reference to `apr_pvsprintf'

I made  ./configure LIBS='-lapr-1 -laprutil-1'. After that I built
activemqcpp again but the error is the same. 

-- 
View this message in context: http://www.nabble.com/build-activemqcpp-embedding-apr1-apr-util-1-static-libraries-%28Linux%29-tp24205943p24205943.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: build activemqcpp embedding apr1/apr-util-1 static libraries (Linux)

Posted by dongabda <do...@ikusi.es>.


Timothy Bish wrote:
> 
> On Thu, 2009-06-25 at 08:51 -0700, dongabda wrote:
>> How can I embed the libapr-1.a and libapr-util-1.a into libactivemqcpp.a? 
>> 
>> I've an application that uses activemq. I put the -lactivemq to the
>> linker
>> flags but compiling it reports this errror: 
>> 
>> /usr/lib/gcc/i386-redhat-linux/4.3.2/../../../libactivemq-cpp.a(libactivemq_cpp_la-Exception.o):
>> In function `decaf::lang::Exception::buildMessage(char const*, char*&)':
>> /home/activemqtest/Download/activemq-cpp-library-3.0/src/main/decaf/lang/Exception.cpp:93:
>> undefined reference to `apr_pvsprintf'
>> 
>> I made  ./configure LIBS='-lapr-1 -laprutil-1'. After that I built
>> activemqcpp again but the error is the same. 
>> 
> 
> Static libs aren't linked with other libs, they are all linked together
> by the linker when you build your executable.  You need to pass to the
> linker all the static libs that your executable needs when you build it.
> 
> Regards
> Tim.
> 
> 
> -- 
> Tim Bish
> http://fusesource.com
> http://timbish.blogspot.com/
> 
> 
> 
> 
> 

I pass to the linker the apr, apr-utils and activempqcc static libraries,
but when I compile it, the compiles gives a lot of errors like this:

usr/lib/gcc/i386-redhat-linux/4.3.2/../../../libactivemq-cpp.a(libactivemq_cpp_la-Exception.o):
> In function `decaf::lang::Exception::buildMessage(char const*, char*&)':
> /home/activemqtest/Download/activemq-cpp-library-3.0/src/main/decaf/lang/Exception.cpp:93:
> undefined reference to `apr_pvsprintf'

Why? 
 

-- 
View this message in context: http://www.nabble.com/build-activemqcpp-embedding-apr1-apr-util-1-static-libraries-%28Linux%29-tp24205943p24215731.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: build activemqcpp embedding apr1/apr-util-1 static libraries (Linux)

Posted by Axel Podehl <ax...@gmail.com>.
I had the same error, and I'm not sure if it helps, but in my case it was
the, somewhat foolish, mistake to add the libraries in the wrong order. Make
sure you FIRST have activemq and THEN apr.

For example:

    gcc -g main.o ${ACTIVEMQ}/lib/64/libactivemq-cpp.a
${APR}/lib/64/libapr-1.a -lstdc++ -lssl -lpthread -ldl -lcrypto -o main



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: build activemqcpp embedding apr1/apr-util-1 static libraries (Linux)

Posted by Timothy Bish <ta...@gmail.com>.
On Thu, 2009-06-25 at 08:51 -0700, dongabda wrote:
> How can I embed the libapr-1.a and libapr-util-1.a into libactivemqcpp.a? 
> 
> I've an application that uses activemq. I put the -lactivemq to the linker
> flags but compiling it reports this errror: 
> 
> /usr/lib/gcc/i386-redhat-linux/4.3.2/../../../libactivemq-cpp.a(libactivemq_cpp_la-Exception.o):
> In function `decaf::lang::Exception::buildMessage(char const*, char*&)':
> /home/activemqtest/Download/activemq-cpp-library-3.0/src/main/decaf/lang/Exception.cpp:93:
> undefined reference to `apr_pvsprintf'
> 
> I made  ./configure LIBS='-lapr-1 -laprutil-1'. After that I built
> activemqcpp again but the error is the same. 
> 

Static libs aren't linked with other libs, they are all linked together
by the linker when you build your executable.  You need to pass to the
linker all the static libs that your executable needs when you build it.

Regards
Tim.


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