=?gb2312?B?u9i4tDogUmU6IFtHZGFsLWRldl0gc2FtZSBjb2RlLCBkaWZmZXJlbnQgcmVzdWx0Pw==?=

gislif gislf at 126.com
Thu Dec 15 10:19:17 EST 2005


Dear Frank  Warmerdam

            Thank you for your advise.I though the backslash is one possible reason.
           When I put the above code in pure console ,it works well. But when I put them in a qt project ,it can't get the dataset . I put these code in the begining of qt  project  after  main() .It should run first .I think if I include file #include "gdal_priv.h" and link gdal lib file ,it should work .




gislif
2005-12-15



·¢¼þÈË£º Frank Warmerdam
·¢ËÍʱ¼ä£º 2005-12-15 22:50:09
ÊÕ¼þÈË£º gislif
³­ËÍ£º gdal-dev at lists.maptools.org
Ö÷Ì⣺ Re: [Gdal-dev] same code, different result?

On  12/15/05,  gislif   <gislf at 126.com >  wrote:
>
>  Hello,
>
>                            Why  the  same  code  has  diferent  result?  I  have  the  following
>  code  in  two  deferent  seperate  program    to  generate  dataset,  one  program
>  (which  has  only  these    codes  )is  ok  ,the  other(which  has  other  program
>  writen  by        qt    )    failed.      why?    seting  mistake?
>
>
>  int  main(  int  argc,  char  **argv  )
>  {
>  //
>    GDALDataset    *poDataset;
>    GDALRasterBand    *poBand;
>
>    GDALAllRegister();
>
>    poDataset  =  (GDALDataset  *)  GDALOpen(  "c:\output.jpg",  GA_ReadOnly  );

"gislif",

Does  the  above  really  work?    My  understanding  is  that  the  backslash
would  always  get  interpreted  as  an  escape  character  on  the  "o"
so  you  would  end  up  trying  to  open  the  file  "c:output.jpg"  which  would
depend  on  your  current  directory.      In  C/C++  I  always  double  backslashes
in  paths.

eg.
GDALOpen(  "C:\\output.jpg",  GA_ReadOnly  );

I  am  not  aware  of  any  reason  GDAL  should  work  differently  in  a  Qt
app  than  not  in  a  Qt  app.

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

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


More information about the Gdal-dev mailing list