Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 29, 2007 Question about DLLs & implib | ||||
---|---|---|---|---|
| ||||
Hi There I have a DLL containing functions having stdcall calling convention. In order to be able to call these functions from inside a D-language program, I tried to create an import lib for the DLL using implib.exe. But the problem is that implib.exe neglects the calling convention of the functions, i.e. doesn't take into account the name decoration, so the linker does not find them. The only solution I see is to use the "C" calling convention instead, and use the option /s (or /system) with implib.exe: implib.exe /system mydll.lib mydll.dll So is there a way to use the stdcall convention instead? Thanks in advance john |
January 30, 2007 Re: Question about DLLs & implib | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Kiro | John Kiro wrote:
> Hi There
>
> I have a DLL containing functions having stdcall calling convention.
> In order to be able to call these functions from inside a D-language
> program, I tried to create an import lib for the DLL using implib.exe.
> But the problem is that implib.exe neglects the calling convention of
> the functions, i.e. doesn't take into account the name decoration, so
> the linker does not find them.
>
> The only solution I see is to use the "C" calling convention instead,
> and use the option /s (or /system) with implib.exe:
>
> implib.exe /system mydll.lib mydll.dll
>
> So is there a way to use the stdcall convention instead?
>
extern(Windows)
|
January 30, 2007 Re: Question about DLLs & implib | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | I'm using "extern(Windows)" already. |
January 31, 2007 Re: Question about DLLs & implib | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Kiro | John Kiro escribió: > Hi There > > I have a DLL containing functions having stdcall calling convention. > In order to be able to call these functions from inside a D-language > program, I tried to create an import lib for the DLL using implib.exe. > But the problem is that implib.exe neglects the calling convention of > the functions, i.e. doesn't take into account the name decoration, so > the linker does not find them. > > The only solution I see is to use the "C" calling convention instead, > and use the option /s (or /system) with implib.exe: > > implib.exe /system mydll.lib mydll.dll > > So is there a way to use the stdcall convention instead? > > Thanks in advance > john If you're talking about DLLs that come with Windows, I remember some of the symbols would be stdcall and others would be C (even in the same DLL), so that might be the case with you right now. Maybe you can use "lib -l" (IIRC) to check how each name is mangled? -- Carlos Santander Bernal |
Copyright © 1999-2021 by the D Language Foundation