[OSM-talk] Osm2Pgsql problem linking to libxml2

yuri bay ksh_wong at msn.com
Mon Feb 12 13:40:32 GMT 2007


Hi Jon,

Many thanks for your help.  I hvae tried the commands you have given me and 
I have two types of errors, but the result look promising as I only have 5 
lines of errors for the second type.  The first type is when I use all the 
command, the result said it cannot find -lz.  Does that mean I need to find 
where is libz?  The second type of error is listed as follows, this is 
generated by using all your commands, but without -lz :

osm2pgsql.o ( . text+0x12d8): osm2pgsql.c: undefined reference to 'asprintf'

This error has 5 lines all together, each with a different location, i.e. ( 
. text+0x15c5) is different for each line.

Is this error cause by not using -lz? It is a *.lib file or *.dll file ??


Hope you could help

Many thanks
Casey Wong


>From: Jon Burgess <jburgess777 at googlemail.com>
>To: yuri bay <ksh_wong at msn.com>
>CC: Nick.Whitelegg at solent.ac.uk, Robert.Hart at BuroHappold.com,  
>talk at openstreetmap.org, dev at openstreetmap.org
>Subject: Re: [OSM-talk] Osm2Pgsql problem linking to libxml2
>Date: Fri, 09 Feb 2007 16:35:10 +0000
>
>On Fri, 2007-02-09 at 15:49 +0000, yuri bay wrote:
> > Hi,
> >
> > I am still trying to solve the osm2pgsql compiling problem.  I wanted to 
>use
> > OSM on winGRASS and need to import OSM data into PostgreSQL.  Since
> > osm2pgsql requires libxml2, I have managed to installed the libxml2, and
> > have downloaded the libxml binary files as wll.  But regardless of that 
>I am
> > still having problem to compile osm2pgsql??  The following is the errors 
>and
> > I would be grateful if someone could help.  Many thanks
> >
> >
> > gcc osm2pgsql.c -o osm2pgsql -L c:/libxml/ -lxml
> >
> > C:/Docume~1/Casey/Local~1/Temp/ccsDaaaa.o(.text+0xae6):osm2pgsql.c:
> > undefined reference to 'xmlStrEqual'
> > ....undefined reference to 'xmlStrEqual'
> > ....undefined reference to 'xmlTestReaderGetAttribute'
> > ....undefined reference to 'bst_insert'
> > ....undefined reference to '_imp_xmlFree'
> > ....undefined reference to 'avl_insert'
> > ....undefined reference to 'bst_balance'
> > ...
> > ...
> > make: *** [osm2pgsql] Error 1
> >
> > I have tried -lxml or -lxml2 the results were the same.  What is -lxml
> > means?
> >
>
>
>'-lxml' means "dynamically link with the library called libxml".
>Any -lFOO causes linking with libFOO.
>
>I'm afraid you need to link together multiple object files to create
>this binary, something like...
>
>gcc -c -o osm2pgsql.o osm2pgsql.c
>gcc -c -o bst.o bst.c
>gcc -c -o avl.o avl.c
>gcc -L c:/libxml/ -lxml2 -lz -lm  osm2pgsql.o bst.o avl.o   -o osm2pgsql
>
>Normally the 'make' tool would handle most of this complexity for you
>(using the instructions it reads from the Makefile). I'm not too
>familiar with the Win32 cygwin/mingw build environment but make should
>be readily available to take care of this for you.
>
>One slightly off topic suggestion is that you would probably find that a
>lot of the OSM tools compile and operate more easily on a Linux distro.
>You should be able to get hold of and install for a quite reasonable
>cost (often $0).
>
>	Jon
>
>

_________________________________________________________________
>From predictions to trailers, check out the MSN Entertainment Guide to the 
Academy Awards® 
http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline1





More information about the talk mailing list