[Gdal-dev] problems compiling gdal with xerces

Mateusz Loskot mateusz at loskot.net
Wed Sep 5 14:35:12 EDT 2007


Edward Fialkowski wrote:
> Hi List, I'm having some problems compiling gdal with xerces support.
> 
> Using xerces veresion 2.7.0 on Redhat.
> 
> I compile xerces from notes at:
> http://xml.apache.org/xerces-c/build-winunix.html#UNIX
> 
> set environment variable
> runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread
> gmake

Edward,

These options look OK.

> Then I go to gdal version 1.4.2 and compile with:
> ./configure CFLAGS=-fPIC CPPFLAGS=-fPIC CXXFLAGS=-fPIC --with-ogr
> --without-python --with-xerces
> make

OK

> Eventually I get:
>  g++ -Wall -fPIC -I/usr/local/include/xercesc
> -I/usr/local/include/xercesc/xercesc -DOGR_ENABLED -fPIC
> -I/usr/local/src/gdal-1.4.2/port -I.. -c iom_attr.cpp  -fPIC -DPIC -o
> ../../o/.libs/iom_attr.o
> In file included from iom_attr.cpp:26:
> ../iom/iom_p.h:43:55: xercesc/framework/LocalFileFormatTarget.hpp: No such
> file or directory
> In file included from iom_attr.cpp:26:
> ../iom/iom_p.h:68: error: expected constructor, destructor, or type
> conversion before "class"
> ../iom/iom_p.h:89: error: `XmlWrtAttr' has not been declared
> ../iom/iom_p.h:89: error: ISO C++ forbids declaration of `attrv' with no
> type
> ../iom/iom_p.h: In destructor `StrX::~StrX()':
> ../iom/iom_p.h:732: error: `release' is not a member of `XMLString'
> ../iom/iom_p.h: In destructor `XStr::~XStr()':
> ../iom/iom_p.h:777: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `const char* iom_getattrname(iom_object*, int)':
> iom_attr.cpp:44: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `char* iom_getattrvalue(iom_object*, const
> char*)':
> iom_attr.cpp:67: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `char* iom_getattrvalueUTF8(iom_object*, const
> char*)':
> iom_attr.cpp:85: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `void iom_setattrvalueUTF8(iom_object*, const
> char*, const char*)':
> iom_attr.cpp:114: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `char* iom_getattrprim(iom_object*, const char*,
> int)':
> iom_attr.cpp:135: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `char* iom_getattrprimUTF8(iom_object*, const
> char*, int)':
> iom_attr.cpp:151: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `const char* iom_getxmleleattrname(iom_object*,
> int)':
> iom_attr.cpp:225: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `char* iom_getxmleleprim(iom_object*, int)':
> iom_attr.cpp:249: error: `release' is not a member of `XMLString'
> iom_attr.cpp: In function `char* iom_getxmleleprimUTF8(iom_object*, int)':
> iom_attr.cpp:266: error: `release' is not a member of `XMLString'
> make[4]: *** [../../o/iom_attr.o] Error 1
> make[4]: Leaving directory `/usr/local/src/gdal-1.4.2
> /ogr/ogrsf_frmts/ili/iom'
> make[3]: *** [iom-target] Error 2
> make[3]: Leaving directory `/usr/local/src/gdal-1.4.2/ogr/ogrsf_frmts/ili'
> make[2]: *** [ili-target] Error 2
> make[2]: Leaving directory `/usr/local/src/gdal-1.4.2/ogr/ogrsf_frmts'
> make[1]: *** [sublibs] Error 2
> make[1]: Leaving directory `/usr/local/src/gdal-1.4.2/ogr'
> make: *** [ogr-target] Error 2
> [root at niceguy gdal-1.4.2]# ls /usr/local/include/xercesc

Hmm, I just tried to build GDAL SVN with Xerces 2.7.0 and I didn't get
any errors. I will check GDAL 1.4.2 release.

> I have tried with XERCESCROOT="/usr/local/src/xerces-c-src_2_7_0/src"
> and XERCESCROOT="/usr/local/src/xerces-c-src_2_7_0/"
> as with various configuration options on gdal for include directory, etc.
> but no idea what they should be set to.

XERCESCROOT is not required nor used by GDAL build configuration.
It's only needed if you build Xerces and then it should point to the
root directory of Xerces sources, the one you get after
unpacking the .tar.gz package.

> The first missing file: xercesc/framework/LocalFileFormatTarget.hpp is
> indeed located at:
> /usr/local/src/xerces-c-src_2_7_0/src/xercesc/framework
> 
> I'm so close to finishing what I need!  does anyone have any ideas what's
> causing this or how to get around it?

I'll check GDAL 1.4.2 today and bring some feedback.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list