开发者

Using libraries compiled for Windows on Linux

开发者 https://www.devze.com 2023-01-31 15:07 出处:网络
I\'m curious. I have a library (static and dynamic version) compiled with v开发者_开发百科isual studio for Windows 64bit which I want to use on Linux. This is a commercial library and to get the same

I'm curious. I have a library (static and dynamic version) compiled with v开发者_开发百科isual 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.


No, you cannot do that, I'm afraid


No you can't do that. You can either try to get the linux version, or build your program on windows and run it on linux with emulator, for example wine.

0

精彩评论

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