title: undefined reference to gdImageString
body: <p>I'm trying to compile a program called Contrafold and I need two libraries (libgd and libpng), the problem is a link the libraries but it through me an undefined reference error, I don't know why....My code to compile is the follow:</p>
  
  <pre><code>g++ -O3 -DNDEBUG -W -pipe -Wundef -Winline --param large-function-growth=100000 -Wall EncapsulatedPostScript.o PlotRNA.o SStruct.o Utilities.o -o plot_rna -lm -L/path-to-library/libgd.a -L/path-to-library/libpng16.a
  </code></pre>
  
  <p>and the errors are:</p>
  
  <pre><code>PlotRNA.cpp:(.text+0x189e): undefined reference to `gdImageString'
  PlotRNA.cpp:(.text+0x1a34): undefined reference to `gdImageFilledArc'
  PlotRNA.cpp:(.text+0x1a79): undefined reference to `gdImageSetAntiAliased'
  PlotRNA.cpp:(.text+0x1ad6): undefined reference to `gdImageChar'
  PlotRNA.cpp:(.text+0x1c76): undefined reference to `gdImageLine'
  PlotRNA.cpp:(.text+0x1fce): undefined reference to `gdImageString'
  PlotRNA.cpp:(.text+0x2036): undefined reference to `gdImageCreateTrueColor'
  PlotRNA.cpp:(.text+0x2079): undefined reference to `gdImageColorAllocate'
  PlotRNA.cpp:(.text+0x2093): undefined reference to `gdImageColorAllocate'
  PlotRNA.cpp:(.text+0x213a): undefined reference to `gdImageColorAllocate'
  PlotRNA.cpp:(.text+0x217d): undefined reference to `gdImageFilledRectangle'
  PlotRNA.cpp:(.text+0x2182): undefined reference to `gdFontGetMediumBold'
  PlotRNA.cpp:(.text+0x218f): undefined reference to `gdFontGetSmall'
  PlotRNA.cpp:(.text+0x223b): undefined reference to `gdImagePng'
  PlotRNA.cpp:(.text+0x2250): undefined reference to `gdImageDestroy'
  </code></pre>
  
  <p>Any options?</p>