Linking against a Win32-DLL
Marc Müller
dont at spam.me
Sun Jul 8 12:48:57 PDT 2007
Hello,
as my first Project in D I am going to write a Application for my Wacom
graphic tablet.
So i have to use a windows dll(wintab32.dll) - but i don't have a
corresponding lib-file.
I have converted the C-Header I found with the dev-kit of my graphic
tablet and converted it to D.
I tried to use the "export(C)" or the "export(Windows)" settings in the
converted header file.
Example from the converted header -> wintab.d:
extern(Windows)
{
UINT WTInfoA(UINT , UINT , LPVOID );
}
demo.d:
import std.stdio;
import wintab;
void main(char[][] args)
{
writefln("Hello World\n");
WTInfo( 0, 0, null);
}
When i compile my Hello-World Application which is calling a function
from the DLL i get the following errormessages from the compiler (using
"extern (C)"):
dmd.exe demo.d -LC:/WINDOWS/system32/wintab32.dll
d:\Projects\wacom\dmd\bin\..\..\dm\bin\link.exe
demo,,,user32+kernel32/noiC:/WINDOWS/system32/wintab32.dll;
OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved
OPTLINK : Warning 9: Unknown Option : NOIC
OPTLINK : Warning 9: Unknown Option : WINDOWS
OPTLINK : Warning 9: Unknown Option : SYSTEM32
OPTLINK : Warning 9: Unknown Option : WINTAB32.DLL
demo.obj(demo)
Error 42: Symbol Undefined _WTInfoA at 12
With "extern(Windows)" the last line reads:
Error 42: Symbol Undefined _WTInfoA
I don't know what to do - and I can not find usefull information for
using Win32-DLLs without a lib-file.
Are my compile settings correct?
Is the converted header correct?
Or is it just not possible using a DLL without a library?
Please give me a hint
Thanks
-Marc-
More information about the Digitalmars-d
mailing list