[Expat-discuss] Statically linking against expat libs

Enrico Weigelt weigelt at metux.de
Fri Jan 18 12:27:10 CET 2008


* Dan Clusin <dclusin at enernoc.com> wrote:

Hi,

> 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

Crosscompiling w/o sysroot ?! 
I suggest switching to an better toolchain ;-P

> The libexpat.a archive does exist there. 

man 1 ld ;-P

use -L to add an search path. (*before* the -l option)

> ./configure --prefix=/home/dclusin/Development/obvius_libs/expat/
> --host=arm-linux-uclibc CC=/usr/local/arm/3.4/bin/arm-linux-gcc
> LFLAGS=-s

s/LFLAGS/LDFLAGS/; ?

> The relevant section of my makefile is as follows:
> 
> CC=/usr/local/arm/3.4/bin/arm-linux-gcc

WTH do you have to touch the makefile instead of using env ? 

> LIBRARIES=-l$(OBVIUS_LIBS)/expat/lib/libexpat.a

*lol* Wrong.

"-l<libname>", NOT "-l<filename>" ;-P

It's the linker's job to find out the correct library filenames.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------


More information about the Expat-discuss mailing list