[Gdal-dev] gdal config icluding xerces

Frank Warmerdam warmerdam at pobox.com
Mon Jul 12 07:55:52 EDT 2004


Daniel Isenegger wrote:
> Hi Frank,
> thanks for for your advice. Unfortunately it still doesn't work. I 
> included your advices:
> 
> ./configure --with-grass=/usr/local/grass-5.7.0 
> --with-pg=/usr/local/pgsql/bin/pg_config --with-xerces 
> --with-xerces-inc=/usr/local/xerces-c-src2_2_0/include/xercesc 
> --with-xerces-lib="-L/usr/local/xerces-c-src2_2_0/lib -lxerces-c 
> -lpthread" --with-odbc=/usr/local/lib 
> --with-static-proj4=/usr/lib/libproj.so | tee configure_disen.log

Daniel,

In your earlier example you were using Xerces 2.1 but now you are showing
2.2 paths.  Did you build 2.2 as well in trying the new paths?  I used
2.2 in my examples because that is what I have installed.

> the error is: cannot find files, e.g. file xercesc/util/XercesDefs.hpp 
> (which is at that location). Does gdal search only the paths given in 
> the configuration or also consider environment vars?

I am not aware of the makefiles or configure using environment vars for
include file search paths.

> g++ -I/usr/local/xerces-c-src2_2_0/include/xercesc 
> /usr/local/xerces-c-src2_2_0/include -o conftest conftest.cpp 
> -L/usr/local/xerces-c-src2_2_0/lib -lxerces-c -lpthread 
> -L/usr/local/grass-5.7.0 -L/usr/local/grass-5.7.0/lib -lgrass5 -lz -lm -ldl
> 
> 
> In file included from conftest.cpp:1:
> /usr/local/xerces-c-src2_2_0/include/xercesc/util/PlatformUtils.hpp:65:39: 
> xercesc/util/XercesDefs.hpp: No such file or directory

Hmm, there seems to be a conflict between how I refer to include files
from xerces in my code (not including the xercesc prefix) and how they
are referred to by Xerces code itself, including the xercesc prefix.
This happens to work for me because due to stuff already having been
pre-installed.

I think you will need an include path that includes the xercesc directory
and the directory above it.  This can't be easily controlled by configure
options as things stand, so you will likely need to hand edit GDALmake.opt
and change the XERCES_INCLUDE to look something like:

XERCES_INCLUDE = -I/usr/local/xerces-c-src2_2_0/include/xercesc \
                  -I/usr/local/xerces-c-src2_2_0/include

I have altered the configure logic in CVS to include both locations and
now the appropriate value to pass in --with-xerces-inc would be the
directory *above* the xercesc directory.

> if i understand you right, you suggest to just install xerces-binaries 
> at the default place and let gdal-config script look for xerces?
> My problem is, there are no xerces-binaries for suse9.1 and in the 
> binaries of former versions, there is no default installation path 
> suggested.

I am suggesting building Xerces from source, and then doing a "make install".
The default install location is under /usr/local and if this had been done
everything would have worked on the first time.  I haven't done a very good
job in explaining other options partly because behind the scenes the
compiler was still finding the stuff under /usr/local even when I tried to
force it to use a different copy.

> if i have installed xerces as i have it now and just run the gdal-config 
> script with --with-xerces the same error as described in the first mail 
> occurs (conftest.cpp:1:34: util/PlatformUtils.hpp: No such file or 
> directory ).

Well, currently you have a *build* tree under /usr/local, as opposed to
having installed it (apparently).

Boy, I just hate build problems on machines I don't have access too. It is
so hard for me to deduce what can be going wrong through the narrow window
of email bug reports.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list