title: How can I build a C/C++ program using `static linking` & `Dynamic linking` with gcc & Visual studio?
body: <p>A library can be used in an application in two ways:</p>
  
  <ol>
  <li>Statically-linked</li>
  <li>Dynamically-linked</li>
  </ol>
  
  <p>But how to do that using both Visual Studio (windows) &amp; GCC?</p>
  
  <p>I know libraries are distributed only in these 4 ways:</p>
  
  <ol>
  <li>Source</li>
  <li>header-only libraries</li>
  <li>*.lib files for windows. *.a for linux</li>
  <li>*.dll (windows) &amp; *.so (linux).</li>
  </ol>
  
  <p>Source distribution is just compiled."header-only libraries" are nothing but a source distribution.</p>
  
  <p>Now if the desired library is distributed in <strong>*.lib</strong> form. Inorder to use it.</p>
  
  <p>On <strong>Visual Stuido</strong> :</p>
  
  <ol>
  <li>We add directory path containing headers(*.h)  to <em>Configuration Properties > General > Additional Include Directories</em></li>
  <li>we add each *.lib file to <em>Configuration Properties > Linker > Input > Additional Dependencies</em></li>
  <li>we add directory path of *.lib files to: <em>Configuration Properties > Linker > Additional Library Directories</em></li>
  </ol>
  
  <p>How to do the same thing for GCC/MingW?
  I don't know how to build my application when the library is distributed as *.dll or *.so too. Can someone tell me what do I need to do in these situations for both Visual studio (windows) and GCC(linux)/mingw(windows)</p>