Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 605 invoked from network); 17 Jan 2005 09:45:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Jan 2005 09:45:23 -0000 Received: (qmail 79772 invoked by uid 500); 17 Jan 2005 09:45:19 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 79742 invoked by uid 500); 17 Jan 2005 09:45:19 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 79725 invoked by uid 99); 17 Jan 2005 09:45:19 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jorton@redhat.com designates 66.187.233.31 as permitted sender) Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 17 Jan 2005 01:45:17 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0H9jEkg006029; Mon, 17 Jan 2005 04:45:14 -0500 Received: from radish.cambridge.redhat.com (radish.cambridge.redhat.com [172.16.18.90]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0H9jDO27892; Mon, 17 Jan 2005 04:45:13 -0500 Received: from radish.cambridge.redhat.com (localhost.localdomain [127.0.0.1]) by radish.cambridge.redhat.com (8.13.1/8.12.7) with ESMTP id j0H9jBPB000622; Mon, 17 Jan 2005 09:45:11 GMT Received: (from jorton@localhost) by radish.cambridge.redhat.com (8.13.1/8.12.10/Submit) id j0H9j74i000619; Mon, 17 Jan 2005 09:45:07 GMT Date: Mon, 17 Jan 2005 09:45:07 +0000 From: Joe Orton To: Graham Leggett Cc: dev@apr.apache.org Subject: Re: Looking for HOWTO: Linking to APR Message-ID: <20050117094507.GC32608@redhat.com> Mail-Followup-To: Graham Leggett , dev@apr.apache.org References: <50795.196.8.104.31.1105713182.squirrel@www.sharp.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50795.196.8.104.31.1105713182.squirrel@www.sharp.fm> User-Agent: Mutt/1.4.1i X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Fri, Jan 14, 2005 at 04:33:02PM +0200, Graham Leggett wrote: > 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 --) must be used at the > compile stage? What flags must be used at the link stage? I'd say: --cppflags, --includes and --cflags at compile stage, --ldflags, --cflags, --libs and --link-ld at link stage, and best using CC as `apr --cc` throughout. > > 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 That's pretty weird. You weren't mixing 64-bit and 32-bit objects or anything? "ar -tv" output on libapr-0.a show anything other than .o files in the archive? joe