0

I have the following question. Consider that some executable file depends from some library. What is the difference for built executable file in case when for linking static or shared library is used?

gcc -o binary main.o -lsomelib, where 'somelib' is 'libsomelib.a' or 'libsomelib.so'. I guess no difference for execution...

I will try to explain more details. I guess that in line above I have really static linking even if libsomelib.so file is used. Is it correct?

I'm not interesting when for linking the option '-Wl,-rpath' is used - it is clear...

Roman Kazmin
  • 931
  • 6
  • 18
  • You can find a detailled answer to your question here: [Difference between static and shared libraries](http://stackoverflow.com/a/2649430/5662998) – Thomas Decroyère Dec 10 '15 at 08:36
  • Possible duplicate of [Difference between static and shared libraries?](http://stackoverflow.com/questions/2649334/difference-between-static-and-shared-libraries) – Humam Helfawi Dec 10 '15 at 08:44

0 Answers0