如何将.dll文件转换为Linux的.so文件 [英] how to convert .dll file to .so file for linux

查看:2351
本文介绍了如何将.dll文件转换为Linux的.so文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有DLL文件(没有源代码)它与windows工作正常,现在我需要为Linux平台编码所以我需要一个.so文件而不是.dll。怎么做?

i have DLL file(without source code) its working fine with windows,now i need to code for Linux platform so i need a .so file instead of .dll. what to do?

推荐答案

这是两个完全不同的系统。你无法转换DLL在Linux系统上运行。
These are 2 complete different systems. You can't "convert" a DLL to run on a linux system.


这有点像试图让雪佛兰与福特引擎一起运行。



简单的答案就是你做不到。如果dll具有您希望转移到linux的重要功能,那么您可以通过大量工作来完成。



查看Microsoft提供的工具的外部链接例如,依赖和dumpbin来检查依赖关系,并且(如果你愿意)转储生成的汇编代码。



使用反汇编程序(或dumpbin)将dll拉开生成汇编代码。查看它调用的库,并确保它只引用C / C ++运行时库(否则这是简单dll的迭代问题,否则如果它链接到Microsoft dll则无法完成)。编辑生成的汇编代码,使其编译并正确链接到系统的正常运行的dll(校验和可能与原始的匹配也可能不匹配)。将更正后的汇编源移动到linux系统并进行必要的更改以链接linux运行时库。



如果dll想要链接到Microsoft库,例如shlwapi等你不能这样做。
This is somewhat like trying to get a Chevy to run with a Ford engine.

The simple answer is that "you can't". If the dll has important functionality that you want to move to linux, you can do it with a significant amount of work.

Look at the external links with Microsoft provided tools such as depends and dumpbin to examine the dependencies and (if you like) dump the generated assembly code.

Use a disassembler (or dumpbin) to pull the dll apart and generate assembly code. Look at the libraries that it calls and make sure that it only references the C/C++ runtime libraries (else this is an iterative problem for simple dlls else it can't be done if it links to Microsoft dlls). Edit the generated assembly code and make it compile and link correctly to a functioning dll for your system (the checksum may or may not match the original). Move the corrected assembly source to the linux system and make whatever changes are necessary to link with the linux runtime libraries.

If the dll wants to link to Microsoft libraries such as shlwapi etc. you can't do it.


这篇关于如何将.dll文件转换为Linux的.so文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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