I would like to use a win32 DLL in what is otherwise a native Linux
application. I want to do this by using WINE.

According to the documentation that comes with the DLL, a Windows
program can load it with the following code (the names have been changed
to protect the innocent -- me):

HMODULE hDLL;
FARPROC lpfnFunc1, lpfnFunc2;

hDLL = LoadLibrary ("library.dll");
if (hDLL == (HMODULE) NULL)
return ERROR;

lpfnFunc1 = (LPAPPFUNC1) GetProcAddress (m_hDLL, "Function1");
lpfnFunc2 = (LPAPPFUNC2) GetProcAddress (m_hDLL, "Function2");

I created the following test program:

#include <wine/wine/winbase.h>

int main (int argc, const char *arvg[])
{
HMODULE hDLL;

hDLL = LoadLibrary ("library.dll")! ;
if (hDLL == (HMODULE) NULL)
return 1;
else
return 0;
}

When I try to build it, however, I get an "undefined reference to
'LoadLibraryA'". Linking libwine.so does not fix this.
Do i try with additional flags for g++ compiler? Or My code is wrong !?
please ,guide me to solve this problem .

Regards
Alireza Mahini


Join Excite! - http://www.excite.com
The most personalized portal on the Web!

Reply via email to