[gdal-dev] How to use GDAL Library

Benoît Andrieu bea at ixsea.com
Mon Mar 30 09:34:18 EDT 2009


Well...

Have you checked your path to your include files ?
Could I see the part of the code where the errors occured ?

Thx

Benoît Andrieu
bea at ixsea.com
benoit.andrieu at gmail.com

  ----- Original Message ----- 
  From: Ajmeri Iqbal 
  To: bea at ixsea.com 
  Cc: gdal-dev at lists.osgeo.org 
  Sent: Monday, March 30, 2009 3:22 PM
  Subject: Re :Re: Re :Re: Re :Re: [gdal-dev] How to use GDAL Library


  Hi,

  Thanks Benoît Andrieubea for your reply.
  you are right, there is no need any cpp file. but when i build the same code given in GDAL tutorial with QT Creator popups the following error.

  g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debugImageRW.exe debug/main.o -L"d:Qt2009.01qtlib" gdal_i.lib -lQtCored4
  mingw32-make[1]: Leaving directory `D:/QT_Projects/ImageRW'

  mingw32-make: Leaving directory `D:/QT_Projects/ImageRW'

  debug/main.o: In function `main':

  D:/QT_Projects/ImageRW/main.cpp:34: undefined reference to `GDALDataset::GetRasterCount()'

  D:/QT_Projects/ImageRW/main.cpp:34: undefined reference to `GDALDataset::GetRasterYSize()'

  D:/QT_Projects/ImageRW/main.cpp:34: undefined reference to `GDALDataset::GetRasterXSize()'

  collect2: ld returned 1 exit status

  mingw32-make[1]: *** [debugImageRW.exe] Error 1

  mingw32-make: *** [debug] Error 2

  Exited with code 2.


  but the same code i builded with VC++ 2005, its working fine.

  unfortunatly i want to link GDAL library in QT.

  the bellow is my QT .pro file setting

  QT -= gui

  TARGET = ImageRW

  CONFIG += console

  CONFIG -= app_bundle

  TEMPLATE = app

  SOURCES += main.cpp

  LIBS += gdal_i.lib

  thanks in advance.



  On Mon, 30 Mar 2009 14:42:07 +0200 Benoît Andrieu wrote







  Hi !
   
  You won't need any cpp files.
  Personally, I am using the FWTools package which 
  bundles dll, libs and headers files.
   
  You just have to compile using gdal_priv.h
  Then link to gdal_i.lib
  Then provide with your runtime all the dlls 
  which gdal_fw.dll is depending to.
  You will find which dlls it is depending to by 
  using Dependency Walker (http://www.dependencywalker.com/).
   
  Then your runtime will be able to use all of the 
  image formats drivers that GDAL was compiled to support.
   
  I hope this will help.
   
  Regards,
   
  Benoît Andrieubea at ixsea.combenoit.andrieu@gmail.com

  ----- Original Message ----- 
  From: 
  Ajmeri 
  Iqbal 
  To: bea at ixsea.com 
  Cc: gdal-dev at lists.osgeo.org 
  Sent: Monday, March 30, 2009 11:06 
  AM
  Subject: Re :Re: Re :Re: [gdal-dev] How 
  to use GDAL Library

  Hi,Actually i m working on Generic image reading/writing and 
  display on viewer with all of its information, so i think i need all listed 
  library. but dont know how to use them in my code.
  i have downloded gdal_i.lib, gdal.dll and its include .h files..h files 
  contains only the prototype function to link with library but i could not find 
  its .cpp file which may containt implementation function of that linking 
  function of .h files.
  can u please give me broad idea or step by step procedure about how do i 
  link these library to c++ code.
  thanks in advanceRegards,IqbalOn Fri, 27 Mar 2009 18:54:01 
  +0100 Benoît Andrieu wroteHi, I 
  am using FWTools 2.2.9So I am releasing my softwares with most of the 
  dlls (you can use depends to find which). The linking is 
  done with 
  :gdal_i.libgeos_i.libgeotiff_i.liblibtiff_i.libproj_i.lib But 
  yo may want to use more or less 
  libraries... Regards, Benoît 
  Andrieubea at ixsea.combenoit.andrieu@gmail.com----- Original Message 
  ----- From: Ajmeri Iqbal To: bea at ixsea.com Cc: 
  gdal-dev at lists.osgeo.org Sent: Friday, March 27, 2009 3:11 
  PMSubject: Re :Re: [gdal-dev] How to use GDAL LibraryHi Benoît 
  Andrieu,Thanks for reply.i already saw that tutorial,but the problame is 
  how to and which library to be linked using QT(most probably same way of 
  C/C++).coz there is a three library named gdal16.dll, gdal_i.lib and 
  gdal.lib.On Fri, 27 Mar 2009 11:33:42 +0100 Benoît Andrieu 
  wroteHi, If you want to use GDAL in C / C++, take a look at the 
  tutorial at http://www.gdal.org/gdal_tutorial.html.It is really 
  straightforward, I used this for the integration of GDAL in our modules 
  and it worked fine. Regards, Benoît 
  Andrieubea at ixsea.combenoit.andrieu@gmail.com----- Original Message 
  ----- From: Ajmeri Iqbal To: gdal-dev at lists.osgeo.org Sent: Friday, 
  March 27, 2009 11:06 AMSubject: [gdal-dev] How to use GDAL LibraryDear 
  all,I want to use GDAL library in my project using QT.How could i use this 
  library for Reading and writing the Raster images (i.e. 
  JPEG,JPEG200,TIFF,GeoTiff,BMP,PNG,GIF, etc)please help me.Thanks in 
  advance_______________________________________________gdal-dev mailing 
  listgdal-dev at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/gdal-dev








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


More information about the gdal-dev mailing list