可能在Linux上使用.dll [英] Possible to use a .dll on Linux

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

问题描述

问题:是否可以使用.dll文件在linux上编译程序?



发生这种情况:
这个.dll将用于向第三方的某些专有软件编写一个php扩展名。



背景与研究:



我已经获得了一个名为 dedicated.lib 的库。我很好奇,因为我以前从未见过 .lib 扩展名,所以我键入:

输出为:

$ b $($)
$ / code
$ b

  priv.lib:当前档案

我做了一些研究,发现 ar 是或多或少的 tar (事实上,我在大多数* nix环境中,guess tar 已经替换了 ar



检查 ar 联机帮助页面时,我看到 t选项,显示内容的表格列表的档案。凉。所以我输入:

  ar t private.lib 

并获取:

  priv.dll 
ownership.dll
...(snip X lines)...


解决方案

您可以尝试提取 ar 文件(Debian包是 ar 文件,fwiw)并运行文件的内容。



您不会在没有翻译的情况下使用Windows DLL。我知道在Linux上本身工作的唯一的DLL文件是用Mono编译的。



如果有人给你一个专有的二进制库进行编码,你应该验证它的编译对于目标架构(没有什么像在x86系统上使用ARM二进制文件),而且它是针对Linux编译的。



这就是说...祝你好运。我讨厌针对第三方库的程序设计,其中有文档来源。


Question: Is it possible to compile a program on linux using a .dll file?

Where this is going: This .dll will be used to write a php extension to some proprietary software from a third party.

Background and Research:

I have been given a library called proprietary.lib. I was curious, as I have never seen the .lib extension before, so I typed:

file proprietary.lib

The output was:

proprietary.lib:  current ar archive

I did some research and found that ar is more-or-less tar (and in fact, I guess tar has since replaced ar in most *nix environments).

Upon inspecting the ar manpage, I saw the t option, which displays a table listing of the contents of that archive. Cool. So I type:

ar t proprietary.lib

And get:

proprietary.dll
proprietary.dll
... (snip X lines) ...

解决方案

You could try extracting the ar file (Debian packages are ar files, fwiw) and run file on the contents.

You're not going to be able to use Windows DLLs without translation. The only DLL files that I know of that work natively on Linux are compiled with Mono.

If someone gave you a proprietary binary library to code against, you should verify it's compiled for the target architecture (nothing like trying to use am ARM binary on an x86 system) and that it's compiled for Linux.

That being said...good luck. I hate programming against third-party libraries where I have the documentation and the source.

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

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