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