digitalmars.D.learn - Making a DLL with a static library dependency
- Phil Deets (5/5) Dec 14 2009 (D 2.033) I'm porting a DLL to D. The DLL depends on a static library, b...
- Phil Deets (4/9) Dec 14 2009 Actually, it depends on another DLL. The static library I need to link t...
- Trass3r (3/7) Dec 15 2009 I'm not sure if the Windows loader does such chained DLL loading.
- Phil Deets (2/9) Dec 15 2009 It worked fine in C++.
- Kagamin (2/4) Dec 15 2009 Well... dll that can't call any function from kernel32.dll is practicall...
- Phil Deets (7/12) Dec 17 2009 (now using D 2.037) I used optlink separately from dmd to see whether th...
- Phil Deets (4/17) Dec 17 2009 I fixed the problem by using implib on lua51.dll to generate a new .lib ...
(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?
Dec 14 2009
On Tue, 15 Dec 2009 00:56:12 -0500, Phil Deets <pjdeets2 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?Actually, it depends on another DLL. The static library I need to link to is an import library for that DLL. I'll work on loading that DLL without the .lib file using the Windows API while I wait for an answer here.
Dec 14 2009
Phil Deets schrieb:Actually, it depends on another DLL. The static library I need to link to is an import library for that DLL. I'll work on loading that DLL without the .lib file using the Windows API while I wait for an answer here.I'm not sure if the Windows loader does such chained DLL loading. But you can always use LoadLibrary & GetProcAddress for that purpose.
Dec 15 2009
On Tue, 15 Dec 2009 07:06:49 -0500, Trass3r <mrmocool gmx.de> wrote:Phil Deets schrieb:It worked fine in C++.Actually, it depends on another DLL. The static library I need to link to is an import library for that DLL. I'll work on loading that DLL without the .lib file using the Windows API while I wait for an answer here.I'm not sure if the Windows loader does such chained DLL loading. But you can always use LoadLibrary & GetProcAddress for that purpose.
Dec 15 2009
Trass3r Wrote:I'm not sure if the Windows loader does such chained DLL loading. But you can always use LoadLibrary & GetProcAddress for that purpose.Well... dll that can't call any function from kernel32.dll is practically useless.
Dec 15 2009
On Tue, 15 Dec 2009 00:56:12 -0500, Phil Deets <pjdeets2 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.
Dec 17 2009
On Thu, 17 Dec 2009 08:32:41 -0500, Phil Deets <pjdeets2 gmail.com> wrote:On Tue, 15 Dec 2009 00:56:12 -0500, Phil Deets <pjdeets2 gmail.com> wrote: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.(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.
Dec 17 2009