apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham Leggett" <minf...@sharp.fm>
Subject Looking for HOWTO: Linking to APR
Date Fri, 14 Jan 2005 14:33:02 GMT
Hi all,

One piece of the docs that seems to be missing is a howto describing the
"right" way to link to APR. apr-config offers me an array of options, but
only indicates help if you're using libtool (I am not, my app is an
application) or want to compile statically (I would like to compile
dynamically). It does not tell you how to link to a dynamic library on the
system in a portable way.

What flags (in other words apr-config --<something>) must be used at the
compile stage? What flags must be used at the link stage?

I have code that links to APR fine on MacOSX, but build the same code on
Solaris v2.8 and it bombs out with the error below. I am pretty sure I am
using the wrong apr-config flags, but without knowing what the right flags
are supposed to be I am pretty stuck:

cc -DHAVE_CONFIG_H -I. -I. -I../../src/include   
-I/udd001/app/spread/usr/include/apr-0 -g -c -o diablo-diablo.o `test -f
'diablo.c' || echo './'`diablo.c
cc  -g   -o diablo -L/udd001/app/spread/usr/lib -lapr-0 -lsendfile -lrt
-lm -lsocket -lnsl -lresolv  -lpthread -ldl diablo-diablo.o
ild: (bad file) archive subfile #1 in
/udd001/app/spread/usr/lib/libapr-0.a is a file of unknown type
*** Error code 1


View raw message