title: Compiling with g++ and having GraphicsMagick++ as static library
body: <p>The following command works</p>
  
  <pre><code>g++ file.cpp $( GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs )
  </code></pre>
  
  <p>but i want a static executable that is not linked to the library, so i have tried</p>
  
  <pre><code>g++ file.cpp $( GraphicsMagick++-config --cppflags --cxxflags --ldflags --libs ) -static
  </code></pre>
  
  <p>but it only generates the following errors</p>
  
  <pre><code>/usr/bin/ld.bfd.real: /usr/lib/gcc/x86_64-linux-gnu/4.6/crtbeginT.o: relocation R_X86_64_32 against `__DTOR_END__' can not be used when making a shared object; recompile with -fPIC
  /usr/lib/gcc/x86_64-linux-gnu/4.6/crtbeginT.o: could not read symbols: Bad value
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>adding <code>-fPIC</code> gives the same result.</p>
  
  <p>I'm using the GraphicsMagick++ version that comes with the standard repository in Ubuntu 12.04 64 bit.</p>
  
  <p>Since GraphicsMagick++ is a fork of ImageMagick some old trick for ImageMagick will probably work but i have never used ImageMagick, only GraphicsMagick++.</p>