|
From: Elias P. <Eli...@ao...> - 2000-12-31 20:37:30
|
Hi-
I am investigating a library. It installs ok, and I have sorted out =
the header issues, but they only provide a .lib file and a .dll file. I =
know there is a .lib-to-.a converter out there, but I am unable to find =
it. However, is it possible to link my program with the dll at linking =
time? The only errors I get with my program are undefined symbols during =
linking.
--Quentin
No, linking time is when the .a file would be needed. What you could try =
is loading the dll at run time. All i know about this is the description =
of the functions LoadLibrary and GetProcAddress. For example you could =
use them like this to call a function inside your dll:
with this declaration in mydll.h:
extern int myfunction(char *);
you could try:
... somewhere at the bginning of the program:
HMODULE mydll; // handle to the dll
int (*mydll_myfunction)(char *); // pointer to the dll function=20
mydll =3D LoadLibrary("MYDLL.DLL");
mydll_myfunction =3D (void *) GetProcAddress(my8dll,"myfunction");
... here you can use the dll function mydll_myfunction
... at the end of the program:
FreeLibrary(mydll);
|