[gdal-dev] OGR with Expat and Xerces library support

Darius darius.jocius at gmail.com
Tue Sep 16 11:01:33 EDT 2008

I'm trying to compile in OGR/GDAL library KML and GPX support, but I
can't get it working. I'm using "makegdal71.vcproj" with VS 2003 and
edited "nmake.opt" as this:

# Uncomment for Expat support (required for KML read support).

EXPAT_DIR = C:\Expat
EXPAT_LIB = $(EXPAT_DIR)\bin\libexpat.lib
# For example full path to libexpat.lib on my PC is: "C:\Expat\Bin

# Uncomment for Xerces based GML support.

XERCES_DIR =	D:\PROJEKTAI\ESRI_MDB_Converter\Lib\xerces\xrc
XERCES_LIB = $(XERCES_DIR)\lib\xerces-c_2.lib
# For example full path to xerces-c_2.lib is "D:\PROJEKTAI

Here is what I'm getting in build log about it:

 link /nologo /dll /debug /INCLUDE:_OGRFeatureStylePuller  /
INCLUDE:_OSRValidate  /INCLUDE:_OPTGetProjectionMethods  /
INCLUDE:_OGR_G_GetPointCount  /INCLUDE:_OGRRegisterAll /
INCLUDE:_GDALSimpleImageWarp at 36  /INCLUDE:_GDALReprojectImage at 48  /
INCLUDE:_GDALComputeMedianCutPCT at 32  /INCLUDE:_GDALDitherRGB2PCT at 28  /
INCLUDE:_OCTNewCoordinateTransformation at 8 /
INCLUDE:_vbSafeArrayToPtr at 16 port\*.obj gcore\*.obj alg\*.obj frmts\o
\*.obj ogr\ogrsf_frmts\ogrsf_frmts.lib ogr\ogr.lib
vb6\vb6_support.obj   D:\PROJEKTAI\ESRI_MDB_Converter\Lib\xerces\xrc
\lib\xerces-c_2.lib C:\Expat\bin\libexpat.lib   odbc32.lib
odbccp32.lib user32.lib                            gcore\Version.res  /
out:gdal15.dll /implib:gdal_i.lib
   Creating library gdal_i.lib and object gdal_i.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of
other libs; use /NODEFAULTLIB:library

Now about how I'm checking if support has been built. Im using just
built version of "ogrinfo" and trying to open gpx file. Getting error:
"ERROR 6: OGR/GPX driver has not been built with read support. Expat
library required"
And with KML file:
"ERROR 1: Unable to create Xerces C++ based GML reader, Xerces support
not configured into GDAL/OGR.
ERROR 1: File ionic_wfs.gml appears to be GML but the GML reader can't
be instantiated, likely because Xerces support wasn't
configured in."

Where could be the problem? I checked library paths several times,
they should be correct. If anybody have any ideas, you are more than

Thank you

More information about the gdal-dev mailing list