-1

When build shared library only header files is enough, but why executables require shared libraries on build stage if anyway symbols will be resolved on runtime and any library can be used in runtime with same declarations like on build time.

Ildar
  • 172
  • 10
  • 2
    Object files are compiled, but not linked. Binaries are compiled and linked. – jabaa Aug 11 '23 at 12:43
  • @jabaa I meant executable, renamed question – Ildar Aug 11 '23 at 12:58
  • _"I meant executable"_ I meant executables, too. Object files are binaries, but (usually) not executables. Executables are compiled and linked. Object files are (usually) only compiled, not linked. Some object files can be linked and executed (at least on a Linux system), e.g. `/lib/x86_64-linux-gnu/libc-2.27.so` can be executed. – jabaa Aug 11 '23 at 13:28
  • The library symbols **are** resolved at link time. We have to make sure that they are all there and don't want to get to know that only at runtime. – BoP Aug 11 '23 at 13:29

0 Answers0