DUB fails to build a dynamic library on Linux

Gabor Mezo via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 14 08:24:13 PST 2014


On Sunday, 14 December 2014 at 16:06:25 UTC, Martin Nowak wrote:
> On 12/14/2014 03:50 PM, Gabor Mezo wrote:
>> Hello,
>>
>> I've created a simple db dynamic lib project.
>
> https://github.com/D-Programming-Language/dub/issues/352

Thanks,

I've did this, it finally build, but something is still not good.

If I call externals from another application, and my D code 
allocates anything on heap, the calling process crashes with 
SIGSEV. I mean it works:

extern (C)
{
	int ping()
	{
		return 555;
	}
}

But it doesn't:

extern (C)
{
	int ping()
	{
                 try { throw new Exception("foo"); } catch 
(Exception ex) { }
		return 555;
	}
}

or this one crashes too:

extern (C)
{
	int ping()
	{
                 auto foo = new Object();
		return 555;
	}
}


More information about the Digitalmars-d mailing list