Single exe vibe.d app

rikki cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 7 00:15:44 PDT 2017


I'm going to give you a very bad but still a good place to begin with 
explanation.

So, what is an executable? Well in modern operating systems that is a 
file with a very complex structure inside, like PE-COFF or ELF. It has a 
bunch of things as part of this, a dynamic relocation table, sections 
and symbols.

Now, there is a very important symbol it provides a "main" function. 
Normally the libc takes ownership of this and then on calls to the 
c-main that we all know and love (druntime uses this and then passes it 
to another symbol called _Dmain).

What is the difference between a shared library and an executable? Well 
not much, no main function for starters (although Win32 based ones do 
have something like it in its place) and a couple of attributes stored 
in the file.

Executables like shared libraries are final binaries, they cannot be 
further linked with, at least with the most common formats + linkers anyway.

You asked about the difference between a static library and a shared 
library, it isn't quite the right comparison. You should be asking about 
static libraries versus object files. In essence a static library is 
just a group of object files. Not too complicated.


More information about the Digitalmars-d-learn mailing list