I downloaded and installed the APR and APR-util C libraries but I can't use them in a project I am doing I keep getting the following errors (I am on Linux Mint):
undefined reference to `apr_pool_initialize'
undefined reference to `apr_pool_create_ex'
etc...
My libraries were originally installed into /usr/local/APR. At first I thought that this file was just not in my cc include path to I copied the /apr/ directory into /usr/local/include and /usr/include both of which are in the include path but I got the exact same errors. I tried adding the lib folder in /apr/ into /etc/ld.so.conf.d/ and then running ldconfig as recommended by the website I am doing the project from but that didn't help either. I thought that I may have installed it improperly so I redid it but that didn't help either. I'm at a loss. If anyone could help me fix this I would really appreciate it. For reference this is the install script I used:
set -e
cd /tmp
curl -L -O http://archive.apache.org/dist/apr/apr-1.4.6.tar.gz
tar -xzvf apr-1.4.6.tar.gz
cd apr-1.4.6
./configure
make
sudo make install
cd /tmp
rm -rf apr-1.4.6 apr-1.4.6.tar.gz
curl -L -O http://archive.apache.org/dist/apr/apr-util-1.4.1.tar.gz
tar -xzvf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1
./configure --with-apr=/usr/local/apr
make
sudo make install
cd /tmp
rm -rf apr-util-1.4.1* apr-1.4.6*
And this is the Makefile I am using, all separations are tabs:
PREFIX?=/usr/local
CFLAGS=-g -Wall -I${PREFIX}/apr/include/apr-1 -
I${PREFIX}/apr/include/apr-util-1 -D_LARGEFILE64_SOURCE=1
LDFLAGS=-L${PREFIX}/apr/lib -lapr-1 -pthread -laprutil-1
all: devpkg
devpkg: bstrlib.o db.o shell.o commands.o
install: all
install -d $(DESTDIR)/$(PREFIX)/bin/
install devpkg $(DESTDIR)/$(PREFIX)/bin/
clean:
rm -f *.o
rm -f devpkg
rm -rf *.dSYM