Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any way to link my program with Wine-compiled part?

Tags:

c++

linux

gcc

wine

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?

like image 842
seas Avatar asked Apr 11 '10 15:04

seas


1 Answers

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
like image 140
Ignacio Vazquez-Abrams Avatar answered Oct 17 '22 08:10

Ignacio Vazquez-Abrams