Is it possible to call DLL functions from a Linux program?

Eloy A. Paris peloy at chapus.net
Mon Apr 14 10:46:54 CDT 2003


Thanks to all that responded.

Just a quick summary of where I stand: after reading the message from
Dan Kegel <dank at kegel.com> I decided to try to make my current Windows
console program work under Wine without X. I unset my DISPLAY variable
a run Wine like this:

wine -- myprogram.exe param1

I was pleasantly surprised to see that this worked like a charm! The
program read its input from stdin and sent its output to stdout; no
messing with X!

wine -v reports 20030115.

It'd be nice to compile myprogram.c as a Linux program, and have that
program use the Windows DLL, but I don't really know how to do that,
and the docs. are not clear enough for me (or seem out of date.)

So, for now, I am all set and happy that myprogram.exe works just fine
without X :)

Thank again.

Cheers,

Eloy.-

On Sun, Apr 13, 2003 at 07:09:48PM -0400, Eloy A. Paris wrote:
> Hi!
> 
> Sorry if this has been covered before, but I could not find any
> answers in the archives or by Googling...
> 
> Here's the situation: I have a Windows DLL and a small Windows program
> that calls functions from this DLL. The Windows program does not have
> a GUI (it's command-line based.) I have the C source code for this
> program, but don't have the source code for the DLL. I built the program
> with Visual C and was able to run it under WINE just fine with wcmd.
> 
> Now, I want to run this program natively under Linux - I mean, I don't
> want to run wcmd because that requires an X server.
> 
> The first question is: is this possible? (have a Unix program that
> calls functions from a native Windows DLL). I started experimenting
> with winelib, but am not sure if this is the correct way...
> 
> If this is possible, how should I do it? I ran winemaker, configure,
> make, but am getting errors from winbebuild.
> 
> Summarizing: I have the C source code. This C program calls function
> foo() that is in a Windows DLL. I want to run this program under Linux
> without the need for an X server. The program calls gets(), printf(),
> etc. I want these functions to be from my Linux's libc, not Windows'.
> 
> Any help will be greatly appreciated.
> 
> Thanks in advance!
> 
> Eloy.-
> 
> P.S. I read the winelib user guide, but couldn't find the answer
> there. If it is there, it's not clear to me :(
> 



More information about the wine-devel mailing list