I found very needed for my binding to lib named GDAL. https://github.com/craig-dillabaugh/gdal
The problem that there is no examples of it's usage. Before I have never used any bindings.
dub.json include next string:
"libs" : ["gdal"]
So it seems that it need lib file with this name.
In the old commits I found example of compilation without dub: dmd test_gdal_d.d gdal.d -L-ldgal
Original gdal distrib do not include lib with such name. There is only gdal111.dll
lib.
So I converted it with implib
to gdal111.lib
. With command implib /s gdal111.lib gdal111.dll
From 11MB lib become 1MB of size.
With Dependency Walker I looked it table of symbols. It's have symbols like GDALGetRasterXSize
I am trying to build all with next command:
dmd D:\code\binding\gdal-master\gdal-master\source\App.d D:\code\binding\gdal-master\gdal-master\source\gdal.d -L -Igdal111.lib
but I am getting next error:
D:\code\binding\gdal-master\gdal-master>dmd D:\code\binding\gdal-master\gdal-master\source\App.d D:\code\binding\gdal-master\gdal-master\source\gdal.d -L -Igdal111.lib
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-2013 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
App.obj(App)
Error 42: Symbol Undefined _GDALClose
App.obj(App)
Error 42: Symbol Undefined _GDALGetRasterCount
App.obj(App)
Error 42: Symbol Undefined _GDALGetRasterXSize
App.obj(App)
Error 42: Symbol Undefined _GDALGetRasterYSize
App.obj(App)
Error 42: Symbol Undefined _GDALOpen
App.obj(App)
Error 42: Symbol Undefined _GDALAllRegister
App.obj(App)
Error 42: Symbol Undefined _GDALIdentifyDriver
App.obj(App)
Error 42: Symbol Undefined _GDALCreate
--- errorlevel 8
I put archive with all stuff here http://dlang.ru/gdal-d-binding.zip
UPD: I got GDAL run!!!
I gist add string:
pragma( lib, "libgdal.lib" );
at example, and it's run. Soon I hope to push some code to github.