views:

59

answers:

1

Say,if the .dll or .lib is written in C,can it be used by other languages like PHP/Python?

+1  A: 

A DLL is binary. As long as your language can consume a binary library (with the OS the binary was compiled for), you should be okay (see exceptions below). LIB files are for the compiler so you'll only be able to use those by C/C++ languages at compile time.

The exception to this is .NET and COM. .NET generates special assembly DLLs to be used by other .NET languages (C#, VB.NET, C++/CLI, IronPython, etc). COM generates special DLLs as well where components (specialized classes) are exposed through the DLL. Natively, C++ and VB6 support COM. .NET languages can access COM DLLs through an interop. Many other languages also support COM bindings by various means.

Go here for a discussion on this topic and more details about the differences.

j0rd4n