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

whitnl73 at whitnl73 at
Sun Apr 13 21:57:53 CDT 2003

On Sun, 13 Apr 2003, 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...

AFAIK, it is the only way.
> If this is possible, how should I do it? I ran winemaker, configure,
> make, but am getting errors from winbebuild.
See "man winemaker".  You might have to fiddle with its options,
or even hand edit a and rerun autoconf.

> 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'.
A winelib program is sort of a Linux program.  If it doesn't import
msvcrt nor crtdll, C function calls will resolve to the Linux libc,
and it has access to the Linux fd's and environment (if Linux is Wine's
host *NIX OS).

You get this letter from pine, by way of a little winelib program
that reads Linux stdin and stuffs it into an ole storage object outbox.

> 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 :(
Doco is not our strong point, but we try.


Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!

More information about the wine-devel mailing list