linking to dll's [unofficial]

Miscellaneous Forums/Win32 Discussion/linking to dll's [unofficial]

an easier way to do this, if you have minGW is to use 2 little tools that comes with minGW *note* still needs the DLL though.

"pexports"
and
"dlltool"

for example you have a dll called mydll.dll
the first step is to go, (from a command window)
pexports mydll.dll >mydll.def

then
dlltool -d mydll.def -l libmydll.a

then you have a libmydll.a file you can put into the blitzmax lib dir.

and can make a module out of it, but REMEMBER it still requires you to have the dll though.

*edit* better mention how to make a mod
make a new dir in the mod directory
for example dragos.mod
in there you can create another dir called for example mymod.mod MAKE SURE IT IS IN LOWERCASE or it wont build it fully.
inside there you create a file called mymod.bmx
which could look like

Import "-lmydll" ' this tells the linker to link with libmydll.a

extern "win32"
   Function MyFunction:int(myvar:int)
end extern