Plugins and D programs

Steve Teale steve.teale at britseyeview.com
Thu Mar 13 23:54:33 PDT 2014


On Thursday, 13 March 2014 at 21:20:10 UTC, Tolga Cakiroglu wrote:
>>> 	dmd main.o ifd.o -L-ldl -defaultlib=libphobos2.so -L-rpath=.
>
> Hmm. I saw that you are using libphobos2.so. I wasn't using 
> this.

Yes, you have to make the program and the plugin both use the 
same runtime, presumably so they are using the same memory 
allocation system, so you link both with libphobos2.so.

It is not just a shut-down artefact, since if I repeat the 
exercise with an exemplar class instead of an interface, then it 
will work.

But then if I make the exemplar class an instance of an 
interface, and call one of the methods that is part of the 
interface it goes back to crashing, so it does seem that this 
behaviour is linked to interfaces.

I will get stuck in with GDB and see if I can find out more, but 
that's not an agreeable experience, so I thought I would ask 
first.

Steve


More information about the Digitalmars-d mailing list