Making a DLL with a static library dependency

Phil Deets pjdeets2 at gmail.com
Thu Dec 17 07:05:22 PST 2009


On Thu, 17 Dec 2009 08:32:41 -0500, Phil Deets <pjdeets2 at gmail.com> wrote:

> On Tue, 15 Dec 2009 00:56:12 -0500, Phil Deets <pjdeets2 at gmail.com>  
> wrote:
>
>> (D 2.033) I'm porting a DLL to D. The DLL depends on a static library,  
>> but when I put the library name on the command-line, dmd does not  
>> output any DLL file. If I remove the library name from the  
>> command-line, dmd gives linker errors and outputs an invalid DLL. How  
>> do I make a DLL with a static library dependency?
>
> (now using D 2.037) I used optlink separately from dmd to see whether  
> the problem is in dmd or optlink. It turns out to be an optlink issue.  
> Everything works fine when I link in phobos.lib and kernel32.lib, but as  
> soon as I link in lua51.lib there is no dll output. Could this be  
> because I compiled lua51.dll/.lib with Visual Studio? I'll try compiling  
> Lua with dmc.

I fixed the problem by using implib on lua51.dll to generate a new .lib  
file. The DLL isn't working properly, but this is likely a different  
issue; so I'll open a new thread for that if necessary.


More information about the Digitalmars-d-learn mailing list