[gdal-dev] Compiling GDAL 1.5.1 for WinCE
Mateusz Loskot
mateusz at loskot.net
Mon Mar 31 19:13:23 EDT 2008
marcello ferrero napisał(a):
> Hi,
> I have the following unresolved external errors compiling gdal 1.5.1 for
> WinCE:
>
> ogrgeometry.obj : error LNK2019: unresolved external symbol
> OGR_G_ExportToKML referenced in function "public: virtual char * __cdecl
> OGRGeometry::exportToKML(void)const "
> ogrgeometry.obj : error LNK2019: unresolved external symbol
> OGR_G_ExportToJson referenced in function "public: virtual char * __cdecl
> OGRGeometry::exportToJson(void)const "
> dbfopen.obj : error LNK2019: unresolved external symbol
> SASetupDefaultHooks referenced in function DBFOpen
> shpopen.obj : error LNK2001: unresolved external symbol
> SASetupDefaultHooks
> shpopen.obj : error LNK2019: unresolved external symbol snprintf
> referenced in function SHPReadObject
>
>
> I solved the problems doing the following:
> a) change ogrgeometry.c and comment out the calls to OGR_G_ExportToKML
> and OGR_G_ExportToJson
> b) "Add Existing" to add shp_vsi.c to the Visual Studio project in
> org->ogr_frmts->shape. This resolves SASetupDefaultHooks
> c) add #include "cpl_port.h" to shapelib.h to resolve snprintf
>
> I don't know if this is the right approach, but now the library is
> correctly created
Marcello,
Yes, these changes are correct except the c) point.
Simply, define preprocessor macro USE_CPL somewhere in the project and
then CPL headers will be included, see
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/shape/shapefil.h#L105
AFAIK, I've written off-list that I recommend you to build GDAL for
Windows CE using solution and project files from the MOSS4G tree as that
one is complete with 3rd party dependencies and up to date:
http://trac.osgeo.org/moss4g/browser/trunk/libs
Project files in the GDAL tree may need some update like the one you've made.
Greetings
--
Mateusz Loskot
http://mateusz.loskot.net
More information about the gdal-dev
mailing list