5

I am trying to use windows dll functionality in Linux. My current solution is a compilation of a separate wine application, that uses dll and transfer requests/responses between dll and main application over IPC.

This works, but is a real overhead comparing to a simple dll calls.

I see that wine-compiled program usually is a bootstrapping-script and some .so, which (according to file utility) is normal linux dynamically linked library.

Are there any way to link that .so directly to my application? Are there any manual?

seas
  • 1,482
  • 2
  • 18
  • 29

1 Answers1

9

You may be able to use Winelib to write a Linux app that can use Windows DLLs.

EDIT:

For future reference:

libtest.c:

#include <stdio.h>
#include <windows.h>
int main(int argc, char* argv[])
{
  HMODULE h;

  h = LoadLibrary("cards.dll");
  printf("%d\n", h);
}

Execution:

$ winegcc -m32 libtest.c 
$ ./a.out
536936448
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • 1
    I couldn't find anything that helped achieve my goal. – seas Apr 11 '10 at 15:57
  • 4
    Not even the `LoadLibrary()` and `GetProcAddress()` functions in wine/windows/winbase.h? – Ignacio Vazquez-Abrams Apr 11 '10 at 16:04
  • Yes, you are absolutely right - I could compile program like your example before, now I've tried simply make a library of it and compile to the main application - and it works. Tried this without loading dll by now, but in general it works. Thanks. – seas Apr 11 '10 at 20:34
  • 1
    If you get: `fatal error: windows.h: No such file or directory`, install wine1.6-dev package. – lepe Oct 02 '15 at 07:19