APR error

If you are using APR (Apache portable runtime) and on compilation of your code you get the following error

apr expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘apr_off_t’

Do this,

$ apr-config --cppflags --cflags

which returns the following on my system

-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pipe -Wall -g -O2 -pthread

Use these while compiling your code.

gcc file.c -o file -I/usr/include/apr-1.0 -lapr-1 `apr-config --cppflags --cflags`