title: gcc compiling and linking
body: <p>I created a shared library in this way</p>
  
  <pre><code>gcc -I/home/lib 'pkg-config --cflags gtk+-2.0 libxml-2.0' -shared -fPIC -Wl,--export-dynamic file1.c file2.c -o lib.so
  </code></pre>
  
  <p>it works and the library created also works for what I need.
  What I want to know is where the compiling and the linking are in this command string, so please explain it to me and tell me a way to divide them in two different commands, just to understand better.
  I need to understand this because I can't not explain why this library works, even if this has to be linked to another one that I've never linked to it.</p>