gcc 4.7.2
Hello,
I am trying to create a shared library that uses the apr (apache portable runtime) library.
However, when I do the following I get this:
ldd libjq.so
linux-gate.so.1 => (0xf777b000)
libdl.so.2 => /lib/libdl.so.2 (0xf774b000)
libapr-1.so.0 => not found
libc.so.6 => /lib/libc.so.6 (0xf7599000)
/lib/ld-linux.so.2 (0x4be59000)
Cannot find it:
libapr-1.so.0 => not found
I have compiled the apr from source so that are not on the system path. I have placed the include and libs in a tools folder to be used with this project.
My directory structure looks like this:
projects/apr_queue/src/job_queue.c
projects/apr_queue/tools/lib/apr*
projects/apr_queue/tools/inc/apr*
I compile and create the object file:
cc -c -m32 -Wall -Wextra -g -I../tools/apr/inc job_queue.c -D_LARGEFILE64_SOURCE -o job_queue.o
And create the shared library like this:
cc -m32 -shared -o libjq.so -L../tools/apr/lib -lapr-1 job_queue.o
There are no linking or compile error. Just the not found for the apr-l library.
Am I missing a step here.
Many thanks for any suggestions,
You could either pass the directory to the linker with
rpaththis will add the directory to the runtime library search pathOr use the
LD_LIBRARY_PATHenviroment variable: