在Linux上使用针对Windows编译的库 [英] Using libraries compiled for Windows on Linux

查看:432
本文介绍了在Linux上使用针对Windows编译的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇。我有一个库(静态和动态版本)编译与Windows 64位的视觉工作室,我想在Linux上使用。这是一个商业图书馆,并且为Linux编译相同的库需要花费很多天的时间发送电子邮件和提醒等等。



我可以使用其中的一种两个库变体(这些不是.net,而是本地库)在Linux机器上链接到它们?理论上,你应该可以这样做。

这将是一项非常多的工作,但这是例如Windows音频/视频编解码器如何由MPlayer加载。



您必须从头开始编写接口包装器,加载dll并修正调用约定。

<然而,这是一项很多工作,如果图书馆是独立的,接口稀缺且易于理解,而另一种选择则需要太多时间,这才是最有意义的。



(基本上,如果你明白为linux和windows编写链接器会怎样):

请让我知道你是否需要任何帮助。


I'm curious. I have a library (static and dynamic version) compiled with visual studio for Windows 64bit which I want to use on Linux. This is a commercial library and to get the same library compiled for Linux will take many days of emailing and reminding and so on and so on.

Can I use one of these two library variants (and these are not .net, but native libraries) to link to them on Linux machine?

解决方案

Theoretically, you should be able to do so.

It would be an awful lot of work, but this is for instance how windows audio/video codecs are loaded by MPlayer.

You would have to write from scratch the interface wrapper, load the dll, and fix up the calling conventions.

It is a lot of work, however, that makes most sense if the library is self-contained, interfaces are scarce and well understood, and the other option would take too much time.

(essentially, if you understand what goes into writing a linker for both linux and windows) :)

Please let me know if you need any help with that.

这篇关于在Linux上使用针对Windows编译的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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