Ability to use .dll in Linux

Question: Is it possible to compile a program in Linux using a DLL file?

Where this happens: This .dll will be used to write a php extension for some third party proprietary software.

Background and study:

I was provided with a library called proprietary.lib . I was curious as I had never seen the .lib extension .lib , so I typed:

 file proprietary.lib 

The output was:

 proprietary.lib: current ar archive 

I did some research and found that ar greater or less than tar (and in fact, I think tar has since replaced ar in most * nix environments).

When checking the ar man page, I saw the t option , which displays a list of the contents of the contents of this archive. Cool. Therefore, I type:

 ar t proprietary.lib 

And we get:

 proprietary.dll proprietary.dll ... (snip X lines) ... 
+7
gcc linux dll ar
source share
3 answers

You can try to extract the ar file (Debian ar files, fwiw packages) and run file in the contents.

You cannot use the Windows DLL without translation. The only DLL files that I know that work on Linux are compiled using Mono.

If someone provided you with a proprietary binary library for code, you should check it compiled for the target architecture (nothing like trying to use the am ARM binary on an x86 system) and compiling it for Linux.

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

+4
source share

. DLL files are usually shared Windows libraries. (It is also possible that someone from Linux built the regular Linux library and for some reason named it .dll.)

Perhaps you could link them using Wine . Support for this was once experimental there - I do not know its current status.

+8
source share

A recent development may have made a difference: there is a loadlibrary function for Linux that allows you to load a Windows DLL and then call functions inside.

So, if your .dll file is actually a Windows DLL, you can find a way to use it in your software.

+1
source share

All Articles