C++ interface problem

extrawurst via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 26 08:49:44 PDT 2015


I hope someone can tell me where my bug is.
I am linking to a dynamic library with C++ interfaces:

```
//alias S = ulong;
struct S
{
   ulong data;
}

extern(C) I getI();

extern(C++) interface I
{
   void foo();
   S bar();
}
```

now the question is why does it crash to access bar() in both 
cases? (using alias aswell as the struct)
The C++ class S is a POD class (it contains only 64bits of data 
and is compiled byte aligned)
The call to bar() from D just crashes on win32, the interface 
works fine on osx 64bit.
Any help would be welcome! Is this even possible to solve ? I 
have no access to the library code so I am not able to build the 
C++ lib with like DMC or something...


More information about the Digitalmars-d-learn mailing list