Open forum for end-user questions about
Wine . Before asking questions, check out the
Wiki as a first step.
Forum Rules
Starry
Newbie
Posts: 3 Joined: Wed Jun 09, 2010 5:28 pm
Post
by Starry » Wed Jun 09, 2010 5:39 pm
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: Select all
int add(int a,int b) {
return a+b;
}
add.h:
int add(int,int);
WinAdd.c:
WinAdd.c:
Code: Select all
#include <windef.h>
#include "add.h"
int WINAPI WinAdd (int a,int b) {
return add(a,b);
}
WinAdd.dll.spec:
Code: Select all
2 stdcall WinAdd (long long) WinAdd
now, i have these all in a directory called test. I type:
Code: Select all
winemaker . --nosource-fix --nomfc -iadd --single-target WinAdd -L"."
(ive already compiled to libadd.so for linux), and then run
And i get:
Code: Select all
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
jorl17
Level 5
Posts: 365 Joined: Mon Jul 28, 2008 6:44 pm
Post
by jorl17 » Wed Jun 09, 2010 6:24 pm
winemaker . --nosource-fix --nomfc -iadd --single-target WinAdd -L"."
Try adding --dll to those options. I should note that I have no experience with this...but are you sure that you did the rest ok? I'm guessing that "--dll" will make it compile, the question is if the rest is ok.
Cheers,
Jorl17
Starry
Newbie
Posts: 3 Joined: Wed Jun 09, 2010 5:28 pm
Post
by Starry » Wed Jun 09, 2010 10:05 pm
Tried it but didnt work
Im not really sure if its all right i though i had pretty much did what the document said to do. Clearly not
Starry
Newbie
Posts: 3 Joined: Wed Jun 09, 2010 5:28 pm
Post
by Starry » Sat Jun 12, 2010 2:35 pm
Anyone? I tried loading an ea which loads a dll, but loading the dll failed, it saying 'something tried to load the c library incorrectly' . Hmmm...
din99
Level 2
Posts: 29 Joined: Sat May 31, 2008 11:37 am
Post
by din99 » Mon Jun 21, 2010 9:50 am
look at the mt4 settings to allow dll, and headers (.h) are called .mqh