It seems that gdal always links it's applications to dynamic lib. at last I change the makefile.vc in the app folder with below lines. !IFDEF DLLBUILD LIBS = $(GDAL_ROOT)\gdal_i.lib !ELSE LIBS = $(GDAL_ROOT)\gdal.lib $(GDAL_ROOT)\ogr\ogr.lib $(GDAL_ROOT)\port\cpl.lib $(GDAL_ROOT)\ogr\ogrsf_frmts\ogrsf_frmts.lib $(ODBCLIB) $(CURL_LIB) $(TIFF_LIB) $(JPEG_LIB) $(PNG_LIB) $(GEOS_LIB) !ENDIF then the applications can run with out gdal18.dll. Best regards! and thank you !
On Wed, Aug 31, 2011 at 2:46 PM, Frank Warmerdam <[email protected]>wrote: > On 11-08-30 06:58 PM, tang wrote: > >> Thanks a lot for your replay! >> >> I got the gdal.lib,but while I link the program to this lib,it still >> needs >> gdal18.dll. this confused me . I had tried to comment out DLLBUILD=1 >> , >> but the commandline programs need gdal18.dll too. even replacing all >> gdal_i.lib with gdal.lib helps nothing. >> I know little about nmake/cl/link, whitch are used in the gdal's vs >> slution. It seems in linux configure we can build static gdal with >> --enalbe-static,but I don‘t know how to do this in VS nmake. >> Best regards! and thank you again! >> > > Tang, > > Well, it took me a while, but I did a default build with MSVC2008 Express > on windows with GDAL 1.8.1 and then issued this command from within the > > cl /MD apps/gdalinfo.c gdal.lib /Ilib /Igcore /Iport /Ialg /Iogr > /Iogr/ogrsf_frmts > > This produced a 4MB gdalinfo.exe (statically linked) that works fine. > > > Best regards, > -- > > ---------------------------------------+-------------------------------------- > I set the clouds in motion - turn up | Frank Warmerdam, > [email protected] > light and sound - activate the windows | http://pobox.com/~warmerdam > and watch the world go round - Rush | Geospatial Programmer for Rent > > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev >
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
