title: How do you actually use a C library?
body: <p>I'm sure this question has been asked many times, but I can't figure this out. Bear with me.</p>
  
  <p>So when you download a library, you get a bunch of .c and .h files, plus a lot of other stuff. Now say you want to write a program using this library.</p>
  
  <p>I copy all the .h files into my project directory. It just doesn't compile.</p>
  
  <p>Great, so then I get the library as a bunch of .dll's, and i copy the dlls into my project directory. Still doesn't compile.</p>
  
  <p>How does this work?</p>
  
  <p>What do you do, like right after creating the folder for your project? What parts of the library package do you copy/paste into the folder? How do you make it so that it can compile? Go through the steps with me please.</p>
  
  <ol>
  <li>Where to put the .h files?</li>
  <li>Where to put the .dll files?</li>
  <li>How to compile?</li>
  </ol>
  
  <p>Thanks.</p>
  
  <p>(the library I'm trying to get working is libpng, I'm in windows with MinGW, and i'm looking to compile from command-line like usual.)</p>
  
  <p>(from what i gather, you put the .h files in directory A and the .dll files in directory B and you can use -l and -L compiler options to tell the compiler where to find them, is this correct?)</p>