Help with simple dll wrapper around linux so

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ive recently got metatrader to work on linux uner wine and would now like to see if i can import a dll wrapper so i can use some code i wrote in linux. Im trying something like this (based on http://www.winehq.org/docs/winelib-guide/bindlls) :

add.c:

Code:
int add(int a,int b) {
  return a+b;
}


add.h:

> int add(int,int);

WinAdd.c:

WinAdd.c:

Code:
#include <windef.h>
#include "add.h" 
int WINAPI WinAdd (int a,int b) {
   return add(a,b);
}



WinAdd.dll.spec:

Code:
2 stdcall WinAdd (long long) WinAdd






now, i have these all in a directory called test. I type:

Code:
winemaker . --nosource-fix --nomfc  -iadd  --single-target WinAdd -L"."



(ive already compiled to libadd.so for linux), and then run 

Code:
make



And i get:

Code:
winegcc  -o WinAdd.so add.o WinAdd.o    -L.   -ladd  
/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: *** [WinAdd.so] Error 2




Can anyone please help?
wine version is 1.1.42 and im on ubuntu
 THanks  :D







[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux