tags:

views:

70

answers:

1

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?

+1  A: 

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
Are there any good manual?
I couldn't find anything that helped achieve my goal.
Not even the `LoadLibrary()` and `GetProcAddress()` functions in wine/windows/winbase.h?
Ignacio Vazquez-Abrams
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.