开发者

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

开发者 https://www.devze.com 2022-12-26 16:46 出处:网络
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

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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号