Unix Software Console Against Something Else

I am writing a program in unix. At the moment, it has a console interface. I'm just wondering how dll on windows a similar concept exists on unix when another program wants to name your program. I was asked to simply provide a binary code with few details. I have a feeling that there might be another program that could call it. So, if I go with this, what do I need to do? I can not share the source. I can only provide a compiled binary (which confuses me a bit too ... when we talk about the binary in unix, this means that some of them are executable and others are not. In the case of my program, I assume that it is executable file is requested at least until confirmation is received). I need to do something special, like provide an api,how do they do it with dll? I'm just not sure how it all works in unix.

+3
source share
5 answers

The unified equivalent of a Windows DLL is a shared library, for example. libfoobar.so.

Regarding how to distribute your code to a third party in binary form, your options are:

  • static library: libfoobar.a
  • shared / dynamic library: libfoobar.so
  • executable file

The first two cases are practically the same. Nowadays, people prefer dynamic libraries because library code can be shared by several executable files, which reduces the size of executable files and the amount of memory.

In both cases, the user of your code will have to write their own code to use your API, and they need to compile their code with your library.

, . - , . , , . UDP TCP , - RPC, SunRPC, SOAP, HTTP, REST, .

+4

, - , Unix.

, " ", , , . - / ( " " pty). stdout stderr ! , "" - , (, .. ..), , ", " ", .

+4

. Linux " " (), Mac OS X " " (dylib) "bundles" (bundle).

. http://www.cs.duke.edu/~ola/courses/programming/libraries.html , *.so.

( popen, .)

+3

DLL () Unix - (*.so).

+3

, (-i.e., SO/DLL- api). DLL , SO - , , , API.

Windows provides qualifiers for functions and variables that certify that characters are visible in the DLL. GCC should also have this.

Here is a link to the GCC documentation and character visibility .

+1
source

Source: https://habr.com/ru/post/1730887/


All Articles