[Gdal-dev] gdalwarp tutorial VS2003 compile error

Huajun Zhang huajun_zhang at usgs.gov
Mon Feb 26 15:38:58 EST 2007


 The code is as following:

    // Get Source coordinate system. 
    const char *pszSrcWKT, *pszDstWKT = NULL;

    pszSrcWKT = GDALGetProjectionRef( hSrcDS );
    CPLAssert( pszSrcWKT != NULL && strlen(pszSrcWKT) > 0 );

    // Setup output coordinate system 
    OGRSpatialReference oSRS;

    oSRS.SetACEA( 29.5, 45.5, 23.0, -96.0, 0.0, 0.0);
    oSRS.SetWellKnownGeogCS( "NAD83" );
    oSRS.exportToWkt( &pszDstWKT );

 Error message:  error C2664: 'OGRSpatialReference::exportToWkt' : cannot 
convert parameter 1 from 'const char **__w64  ' to 'char ** '

Thanks

Huajun Zhang




Mateusz Loskot <mateusz at loskot.net> 
Sent by: gdal-dev-bounces at lists.maptools.org
02/26/2007 03:02 PM

To
gdal <gdal-dev at lists.maptools.org>
cc

Subject
Re: [Gdal-dev] gdalwarp tutorial VS2003 compile error






Huajun Zhang wrote:
> 
> I am trying to use some code from gdal warp API tutorial, but I meet the
> compile error in VS2003:
>  error C2664: 'OGRSpatialReference::exportToWkt' : cannot convert
> parameter 1 from 'const char **__w64  ' to 'char ** '
> 
> Do you have any idea to fix the problem?

You're probably passing const pointer where non-const is expected.
Please, show us exact code you're using, with line where you call
exportToWkt().

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net
_______________________________________________
Gdal-dev mailing list
Gdal-dev at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/gdal-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070226/ec352d1d/attachment.html


More information about the Gdal-dev mailing list