Help with simple winelib dll

Seth Burleigh seth at tewebs.com
Tue Jun 15 21:04:58 CDT 2010


Im attempting to build a dll which a windows program running under wine
can dynamically load. The dll will be a wrapper around a linux library.
In preparation ive tried to follow the instructions here
http://www.winehq.org/docs/winelib-guide/bindlls
with a simple example but have not succeeded. Below is the contents of
the files in my directory and the commands i executed. Can anyone help
out? Thanks!



MyLinuxFunc.c
	int MyLinuxFunc(int a,int b) {
 		return a+b;
	}
-----------------------------
MyLinuxFunc.h
	int MyLinuxFunc(int,int);
-----------------------------
libMyLinuxFunc.so
-----------------------------
MyWin.dll.spec
    2 stdcall MyWinFunc (long long) MyProxyWinFunc
-----------------------------
MyWin.c
    
	#include <MyLinuxFunc.h>
	#include <windef.h> 
	int WINAPI MyProxyWinFunc (int a,int b)
	{
   	 return MyLinuxFunc(a,b);
	}
-----------------------------


winemaker . --nosource-fix --dll --single-target MyWin --nomfc -I"."
-L"." -iMyLinuxFunc

make
winegcc  -o MyWin.so MyLinuxFunc.o MyWin.o    -L.   -lMyLinuxFunc  
MyWin.o: In function `MyProxyWinFunc':
MyWin.c:(.text+0x20): undefined reference to `MyLinuxFunc'
/usr/lib/wine/libwinecrt0.a(exe_main.o): In function `main':
(.text+0xa0): undefined reference to `WinMain'
collect2: ld returned 1 exit status
winegcc: i486-linux-gnu-gcc failed
make: *** [MyWin.so] Error 2





More information about the wine-devel mailing list