tags:

views:

75

answers:

2

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) ...
+1  A: 

.dll are usually Windows shared libraries. (It's also possible that somebody on Linux has built a regular linux lib and called it .dll for some reason)

It's possible you could link against them using wine, support for this was once in there as experimental - I don't know it's current status.

Martin Beckett
+1  A: 

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.

Broam
Tried extracting and re-running file command on the sole .dll file that was produced and the output was "data".
random_hero
If it's not seen as a shared object or some sort of executable file...you're out of luck.
Broam