Re: DMD - issue building shared library

2016-01-18 Thread Dibyendu Majumdar via Digitalmars-d
On Monday, 18 January 2016 at 05:58:38 UTC, bitwise wrote: On Sunday, 17 January 2016 at 22:12:44 UTC, Dibyendu Majumdar wrote: Presumably there is no compiler flag to auto generate this? There's no compiler flag, but you can use this:

Re: DMD - issue building shared library

2016-01-18 Thread Dibyendu Majumdar via Digitalmars-d
On Monday, 18 January 2016 at 23:53:45 UTC, Dibyendu Majumdar wrote: Thanks - that worked, but I had to write it this way: import std.c.windows.windows; import core.sys.windows.dll; mixin SimpleDllMain; I noticed that above modules are documented in the library reference so I assume

Re: DMD - issue building shared library

2016-01-18 Thread bitwise via Digitalmars-d
On Monday, 18 January 2016 at 23:55:33 UTC, Dibyendu Majumdar wrote: On Monday, 18 January 2016 at 23:53:45 UTC, Dibyendu Majumdar wrote: Thanks - that worked, but I had to write it this way: import std.c.windows.windows; import core.sys.windows.dll; mixin SimpleDllMain; I noticed that

Re: DMD - issue building shared library

2016-01-17 Thread bitwise via Digitalmars-d
On Sunday, 17 January 2016 at 22:12:44 UTC, Dibyendu Majumdar wrote: Presumably there is no compiler flag to auto generate this? There's no compiler flag, but you can use this: https://github.com/D-Programming-Language/druntime/blob/master/src/core/sys/windows/dll.d#L473 Bit

Re: DMD - issue building shared library

2016-01-17 Thread bitwise via Digitalmars-d
On Sunday, 17 January 2016 at 16:10:01 UTC, Dibyendu Majumdar wrote: LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup _DllMainCRTStartup: D shared libs on windows still require a DllMain. If you follow this post here[1] to create one, it should solve some of your problem.

Re: DMD - issue building shared library

2016-01-17 Thread Dibyendu Majumdar via Digitalmars-d
On Sunday, 17 January 2016 at 19:10:16 UTC, bitwise wrote: On Sunday, 17 January 2016 at 16:10:01 UTC, Dibyendu Majumdar wrote: LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup _DllMainCRTStartup: D shared libs on windows still require a DllMain. If you follow this post

DMD - issue building shared library

2016-01-17 Thread Dibyendu Majumdar via Digitalmars-d
Hi I have an existing C shared library that I am trying to link to a D shared library. The D shared library at present only has a binding (extern (C)) definition, nothing else. When I try to create the shared library using the DMD command line I get link errors. Platform is Windows 10