Calypso: Direct and full interfacing to C++
Kelly via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Tue May 19 10:15:47 PDT 2015
On Tuesday, 19 May 2015 at 08:09:33 UTC, Suliman wrote:
> modmap (C++) "<gdalwarper>";
>
> import std.stdio;
>
> void main()
> {
> GDALDatasetH hSrcDS, hDstDS;
> GDALAllRegister();
> writeln("hello");
> }
>
>
> error:
> app.d(7): Error: undefined identifier GDALDatasetH
> app.d(7): Error: undefined identifier GDALDatasetH
> app.d(8): Error: undefined identifier GDALAllRegister
Hello Suliman,
I have translated the GDAL example (
http://www.gdal.org/warptut.html ) and got it to run...woohoo!! I
needed to apply the fix from Elie last night (and the pull
request from me that hasn't been accepted yet), so this won't
work for you yet, unfortunately...soon hopefully.
For comparison I have posted the translation here (
http://pastebin.com/VwrVeBJ3 ), but it may be a day or two yet
before Calypso can compile it out-of-the-box, even if my pull
requrest is accepted today. There is still one outstanding error
that I couldn't fix. I had to cheat and modify a system file (not
a good thing to ask others to do, obviously)!!
As you can see the differences between the two examples are
pretty minimal. Things like using '.' instead of '->'. Having to
'new' the GDALWarpOperation, and another slightly subtle change
-- we need to use an ampersand for the function pointer
assignment of GDALTermProgress/GDALAGenImgProjTransform.
Also notice that we needed to explicitly modmap cpl_conv.h to get
access to CPLMalloc. In addition, we have to be explicit about
which structs/classes to 'import'.
I have not tested this on Windows! I haven't even built Calypso
on Windows yet...so I may not be able to help much with Windows
errors. Just so you know.
Thanks,
Kelly
More information about the Digitalmars-d-announce
mailing list