[Expat-discuss] Statically linking against expat libs
Dan Clusin
dclusin at enernoc.com
Fri Nov 2 20:44:31 CET 2007
Good day everyone,
I'm trying to write a program that statically links against expat. The
target platform I am writing for is an embedded arm board running
embedded linux (using uClibc). When I compile my program using the
vendor provided tool-chain (gcc variant targeting the arm platform) I
get the following error:
/usr/local/arm/3.4/bin-ccache/../lib/gcc/arm-linux-uclibc/3.4.3/../../..
/../arm-linux-uclibc/bin/ld: cannot find
-l/home/dclusin/Development/obvius_libs/expat/lib/libexpat.a
The libexpat.a archive does exist there. I have google searched for this
particular problem, but haven't found any useful advice. Most of the
static linking advice that I have seen doesn't pertain to expat, or
doesn't solve my problem. I have configured the source for expat using
the following options:
./configure --prefix=/home/dclusin/Development/obvius_libs/expat/
--host=arm-linux-uclibc CC=/usr/local/arm/3.4/bin/arm-linux-gcc
LFLAGS=-s
The relevant section of my makefile is as follows:
CC=/usr/local/arm/3.4/bin/arm-linux-gcc
CFLAGS= -O3 -Wall -c
LFLAGS= -static
OBVIUS_LIBS=/home/dclusin/Development/obvius_libs/
LIBRARIES=-l$(OBVIUS_LIBS)/expat/lib/libexpat.a
#...
#$(objects) is rather long so I left it out for clarity's sake.
myApp: $(objects)
$(CC) $(LFLAGS) $(LIBRARIES) -o myApp $(objects)
Perhaps it could be because I mis-configured my source build of expat,
or I have inadvertently screwed something up in my make file. Any ideas
that you can offer are greatly appreciated. If you need more
information, please don't hesitate to ask. I tried to provide everything
I thought was pertinent with out giving you the kitchen sink.
Regards,
Daniel Clusin
EnerNOC, Inc.
(617)5328154
This email and any information disclosed in connection herewith, whether
written or oral, is the property of EnerNOC, Inc. and is intended only
for the person or entity to which it is addressed. This email may
contain information that is privileged, confidential or otherwise
protected from disclosure. Distributing or copying any information
contained in this email to anyone other than the intended recipient is
strictly prohibited.
More information about the Expat-discuss
mailing list