c++ - Runtime dependency and build dependency concepts -


i have been hearing build dependency / runtime dependency. quite self explanatory terms. far understand, build dependency used components required in compile time. example if has build dependency b, cannot built without b. runtime dependency on other hand dynamic. if has runtime dependency b, can built without b cannot run without b.
information shallow. i'd read , understand these concepts better. have been googling not find source, can please provide me link or right keywords search?

i'll try keep simple , theoretical only.

when write code calls function "func", compiler needs function descriptor (e.g. "int func(char c);" available in .h files) verify arguments correctness , linker needs function implementation (where actual code reside).

operating systems provide mechanism separate functions implementation different compiled modules. required

  1. better code reuse (multiple applications can use same code, different data context)
  2. more efficient compilation (you don't need recompile dependency libraries)
  3. partial upgrades
  4. distribution of compiled libraries, without disclosing source code

to support such functionality compiler provided function descriptors (.h files) usual. while linker provided lib files containing function stubs. operating system responsible load actual implementation file during application loading procedure (if not yet loaded different application) , map actual functions memory of new application.

dynamic load functionality extended object oriented languages (c++, c#, java , etc.)

practical implementations os dependent - dynamic linking implemented dll files in windows or files in linux

special os dependent techniques can used share context (variables, objects) between different applications uses same dynamic library.

meir tseitlin


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -