I'm following the preliminary example "Dynamically Loading a D DLL From a C Program" here: http://dlang.org/dll-linux.html#dso9

Firstly, my output is different:

+main()
libdll.so is loaded
dll() function is found
dll()
unloading libdll.so
-main()

If looks like static this and ~this are not being called.

Secondly, when I replace printf with writeln, I get a seg fault. Trying to do just about anything beyond adding numbers and returning the result causes a similar crash.

I'm wondering whether D runtime is being initialized correctly. Can anyone suggest what I would do to ensure this? A more finalized example would be useful also.

DMD64 D Compiler v2.066.0
Ubuntu 10.04 64bit

Many thanks,
John

Reply via email to