[Gdal-dev] Re: RESOLVED: GDAL support for GML w/ Xerces 2.3.0
Jack Varga
jvarga at boulder.net
Mon Sep 15 00:57:19 EDT 2003
From Xerces C 2.3.0 doc/html/program-others.html#CPPNamespace...
Xerces-C++ 2.3.0 now supports C++ Namespace.
- users' applications must namespace qualified all the Xerces-C++
classes/data/variables with "xercesc::" or add the "using namespace
xercesc" clause.
So I modified configure so it would pass conftest...
$ diff ../clean/configure ..modifiedl/configure
21076,21078c21076,21078
< LIBS="-lxerces-c1_6_0 -lpthread $LIBS"
< if test -f /usr/local/lib/libxerces-c1_6_0.so ; then
< LIBS="-L/usr/local/lib $LIBS"
---
> LIBS="-lxerces-c -lpthread $LIBS" # was
LIBS="-lxerces-c1_6_0"
> if test -f /usr/local/xerces-c-2_3_0/lib/libxerces-c.so.23.0 ; then
> LIBS="-L/usr/local/xerces-c-2_3_0/lib $LIBS"
21084,21085c21084,21085
< if test -d /usr/local/include/xercesc ; then
< XERCES_INCLUDE="-I/usr/local/include/xercesc"
---
> if test -d /usr/local/xerces-c-2_3_0 ; then
> XERCES_INCLUDE="-I/usr/local/xerces-c-2_3_0/include"
21091c21091,21096
< echo '#include <util/PlatformUtils.hpp>' > conftest.cpp
---
> # Xerces-C++ 2.3.0 now supports C++ Namespace.
> # From doc/html/program-others.html#CPPNamespace
> echo '#include <xercesc/util/PlatformUtils.hpp>' > conftest.cpp
> echo '#include <xercesc/sax/HandlerBase.hpp>' >> conftest.cpp
> echo '#define XERCES_HAS_CPP_NAMESPACE' >> conftest.cpp
> echo 'using namespace xercesc;' >> conftest.cpp
I also modified ogr/ogrsf_frmts/gml/gmlreaderp.h (although not clear
why this was necessary using namespaces)
diff ../clean/gdal/ogr/ogrsf_frmts/gml/gmlreaderp.h
../modified/gdal/ogr/ogrsf_frmts/gml/gmlreaderp.h
64,68c64,68
< #include <util/PlatformUtils.hpp>
< #include <sax2/DefaultHandler.hpp>
< #include <sax2/ContentHandler.hpp>
< #include <sax2/SAX2XMLReader.hpp>
< #include <sax2/XMLReaderFactory.hpp>
---
> #include <xercesc/util/PlatformUtils.hpp>
> #include <xercesc/sax2/DefaultHandler.hpp>
> #include <xercesc/sax2/ContentHandler.hpp>
> #include <xercesc/sax2/SAX2XMLReader.hpp>
> #include <xercesc/sax2/XMLReaderFactory.hpp>
Not sure all this was necessary, (I'm not a big C++ coder) but its what
I needed to compile in support for Xerces 2.3.0 and GML and wanted some
place to document my modifications in the chance it can help someone else...
-jv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20030914/dead3355/attachment.html
More information about the Gdal-dev
mailing list