有没有什么办法链接我的程序与葡萄酒编译的部分? [英] Are there any way to link my program with Wine-compiled part?

查看:152
本文介绍了有没有什么办法链接我的程序与葡萄酒编译的部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Linux中使用windows dll功能。
我当前的解决方案是一个单独的葡萄酒应用程序的编译,使用dll和dll和主要应用程序之间的传输请求/响应通过IPC。



但是对比一个简单的dll调用是一个真正的开销。



我看到葡萄酒编译程序通常是一个引导脚本和一些.so, em>文件实用程序)是正常的linux动态链接库。



有没有办法将.so直接链接到我的应用程序?

解决方案

您可以使用 Winelib 编写一个可以使用Windows DLL的Linux应用程序。



EDIT: / p>

以后参考:



libtest.c

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

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

执行:

  $ winegcc -m32 libtest.c 
$ ./a.out
536936448


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

这篇关于有没有什么办法链接我的程序与葡萄酒编译的部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆