<br><font size=2 face="sans-serif">Thanks a lot. It works. </font>
<br>
<br><font size=2 face="sans-serif">Huajun Zhang</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Mateusz Loskot <mateusz@loskot.net></b>
</font>
<br><font size=1 face="sans-serif">Sent by: gdal-dev-bounces@lists.maptools.org</font>
<p><font size=1 face="sans-serif">02/26/2007 04:35 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">gdal <gdal-dev@lists.maptools.org></font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [Gdal-dev] gdalwarp tutorial VS2003
compile error</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Huajun Zhang wrote:<br>
> <br>
> The code is as following:<br>
> <br>
> // Get Source coordinate system. const char *pszSrcWKT, *pszDstWKT
=<br>
> NULL;<br>
<br>
Here, you're declaring *const* pointers to char.<br>
<br>
> oSRS.exportToWkt( &pszDstWKT );<br>
<br>
Here, you pass const pointer where non-const is expected.<br>
Also, it's a good idea to check the manual to see what types are expected:<br>
<br>
http://www.gdal.org/ogr/classOGRSpatialReference.html#8b8123ea88b3e2ffb082e5eec06d52d5<br>
<br>
Because of C/C++ strong type safety, the const qualifier is not removed<br>
implicitly.<br>
<br>
You have two choices:<br>
<br>
1) Declare the pszDstWKT as a non-const pointer:<br>
<br>
char* pszDstWKT = NULL;<br>
<br>
2) Leave the pszDstWkt declared as const char* and ask the compiler to<br>
remove the const qualifier:<br>
<br>
oSRS.exportToWkt( const_cast<char**>(pszDstWKT) );<br>
<br>
Cheers<br>
-- <br>
Mateusz Loskot<br>
http://mateusz.loskot.net<br>
_______________________________________________<br>
Gdal-dev mailing list<br>
Gdal-dev@lists.maptools.org<br>
http://lists.maptools.org/mailman/listinfo/gdal-dev<br>
</tt></font>
<br>