I am writing a program in unix. At the moment, it has a console interface. I am just curious like dll’s in windows does a similar concept exist in unix when another program wants to call your program. I have been asked to simply provide a binary with little else in terms of details. I have a feeling that there might be another program that might be calling this. So if I go with that what would I need to do? I cannot share source. I can only provide a compiled binary (which i am a bit confused about as well…when we talk about binary in unix that means that some are executable while others are not. In the case of my program I assume its an executable they are asking for at least till I get a confirmation). would i need to do anything special like provide api’s like they do with dlls? i am just not sure how that all works out in unix.
Share
The unix equivalent of a Windows dll is a shared library, e.g.
libfoobar.so.With regards to how to distribute your code to a third party in binary form your options are:
libfoobar.alibfoobar.soThe first two cases are effectively the same. People tend to prefer dynamic libraries these days, because the library code can be shared by multiple executables making both the size of the executables and the amount of memory required smaller.
In both cases the user of your code will have to write their code to use your API, and they need to compile their code against your library.
In the third case you would provide the third party with an executable that they run. They would call into your application via some sort of Inter process communication mechanism, e.g. pipes or shared memory, or over the network, e.g. UDP or TCP as a low level mechanism, or some sort of RPC mechanism like SunRPC, SOAP, HTTP, REST, what have you.