[Gdal-dev] GDAL C API and Delphi

Ivan Lucena ILucena at clarku.edu
Fri Apr 13 11:18:42 EDT 2007


Artur,

Take a look a Dr. Bob's Delphi Clinic: http://www.drbob42.com/delphi/headconv.htm

But don't get me wrong, I am not saying that you should use the automatic header conversion tool HeadConv. It tried it and it didn't work for gdal.h.

You are going in the right direction with your Delphi interface unit, but what you need is to create a .DEF file, something like "gdal14.def", and then use the "/def:gdal14.def" option in the linker of gdal14.dll in gdal/makefile.vc.

If you are using VC project the path for that option is:

"Project Properties/Configuration Properties/Linker/Module Definition file"

I hope that will help you Artur.

- - - -

Frank,

I am wondering... Some open source project in C/C++ already comes with those .DEF files and with the /def: in dll link option, e.g.:

- HDF41rs5s
- ImageMagick
- Shapelib
- wxWidgets
- Lua
- Goggle Desktop-DK

Maybe we should consider adding it to the GADL makefile.vc too.

What do you thing?

- - - -

Pozdrowienia / Regards

Ivan

________________________________________
From: gdal-dev-bounces at lists.maptools.org [mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of Artur Redzko
Sent: Friday, April 13, 2007 3:39 AM
To: gdal-dev at lists.maptools.org
Subject: [Gdal-dev] GDAL C API and Delphi


Hi 

Is there any special procedure to build GDAL DLL, that can be mapped and used in Delphi through C API. I built DLL using Visual C++ express 2005, tested exports using dumpbin - it looks fine. But when I try to map it in Delphi like : 

var
  GDALAllRegister : procedure; stdcall; 

..... 
  DLLHandle := LoadLibrary('gdal14.dll');
  if DLLHandle >= 32 then
  begin
    @GDALAllRegister := GetProcAddress(DLLHandle,'GDALAllRegister');
    ..... 
  end 

all functions addresses ( using names ) return nil like there is no function with such name (taken from gdal.h). 

I tested it with daily and gdal 4.1 source with default settings. I also tried to get binaries from vterrain but they also don't work. Strangely found old 1.2 version works. 

Can anyone help me ? What do I do wrong ? 

Can someone send me compiled binaries for Windows ? 

Ps. Sorry for doubled emails. I have problem with my email server.

Regards
Artur 








More information about the Gdal-dev mailing list