Compiling libgdal

Frank Warmerdam warmerdam at p...
Thu Nov 30 09:23:15 EST 2000


Justin Hickey wrote:
> 
> Hi Frank
> 
> I finally got GNU make installed and tried to compile the gdal library.
> However, I got several errors like the following:
> 
> ld32: ERROR 33: Unresolved text symbol "png_set_IHDR" -- 1st referenced
> by /usr/people/jhickey/gdal-1.1.2/gdal.a(pngdataset.o).
> Use linker option -v to see when and which objects, archives and dsos
> are loaded.
> 
> Obviously, the linker cannot find the png library, but I can't seem to
> find a good place to define it in GDALmake.opt. Do you have any ideas?

Justin, 

The problem is (I think) that the pngdataset.cpp file is compiled based
on the png include files distributed with gdal, but tries to link against
the installed png (by default). This is intended to make it easier to link
against a pre-installed libpng even if you didn't install the corresponding
development package. However, in practice there seems to be enough variation
in the actual libpng.so's people have installed to make this a bad idea. 

You can get around this problem with the configure switch --with-png=internal
to compile and link in the png code distributed with gdal. I should likely
move the png code, and include files into a subdirectory, and avoid including
the include files in the include path when using external libpng; however, 
I am hesitant to do that. 

I am changing the AC_CHECK_LIB() call in configure.in to look for png_set_IHDR
instead of the old function it was looking for. Hopefully this will make it
easier to segregate out the version of libpng to link against. Perhaps you
could cvs update, and reconfigure with my new configure to see if this test
successfully switches things to "internal" png mode?

Also, could you provide an "ls -l /usr/lib/libpng*" report, and any other
information on the version of libpng you have installed?

Note, the same sorts of issues can arise with libtiff, and libjpeg. The 
build information on the GDAL page does briefly address the need to use 
internal versions of libraries in some cases. 

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
light and sound - activate the windows | http://pobox.com/~warmerda
and watch the world go round - Rush | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list