[Gdal-dev] Problems building gdal dll with libtool on MinGW

Andrey Kiselev dron at ak4719.spb.edu
Tue Feb 17 02:15:37 EST 2004


On Mon, Feb 16, 2004 at 10:14:49PM -0500, Mario Beauchamp wrote:
> Up to now, I had always built gdal as a static lib and everything was
> fine. When I tried to build a shared gdal using libtool, it complained
> about the fact that I didn't have shared versions of libm and libz and
> I ended up with a static lib.

Mario,

We don't need to link with libm when compiling with MinGW. This problem
was fixed few weeks ago.

> How do I tell the gdal configure to add -lz and -lm when linking?  I
> tried configuring with "--enable-static=libz,libm" but got the same
> complaints and a static lib again. I never used libtool before and the
> doc is very confusing to me... so I don't know what to do next.

All external libraries shoyld be dinamic too. This is not a problem in
case of libz, because it can be simply compiled in (use
--with-zlib=internal option), but if you want to link against libraries,
not included in GDAL distribution, you should build them dinamically.

> And if I understand libtool correctly (don't bet on that!), a dll
> created with libtool needs libtool to link, right?

No, it can be the drop-in replacement for gdal.dll, compiled with the
MSVC. The only problem here is a C++ name mangling. If your application
uses C++ interface you should use MinGW (and the same gcc version) to
build it. If you are limited by the C API it is not a problem and you
can combine GDAL compiled with mingw and application compiled with MSVC.

						Andrey

-- 
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517



More information about the Gdal-dev mailing list