title: Issue with LibPng (incomplete type, forward references) on Snow Leopard
body: <p>I am using MAC OS Snow Leopard and have tried to compile my program, a1.cpp, but I seem to have trouble with the linking libpng. Is this my issue? If not, what is? And, how can I resolve it?
  Thanks in advance </p>
  
  <pre><code>ew-host-2:a1 gifford$ make
  
   g++ -O3 -o a1 a1.cpp -I . -L/opt/local/lib -lpng
   In file included from a1.cpp:2:0:
  ./SImageIO.h: In static member function 'static void SImageIO::read_png_file(const char*, SDoublePlane&amp;, SDoublePlane&amp;, SDoublePlane&amp;)':
  ./SImageIO.h:97:23: error: invalid use of incomplete type 'png_info {aka struct png_info_def}'
  In file included from ./SImageIO.h:21:0,
               from a1.cpp:2:
  /opt/local/include/png.h:566:16: error: forward declaration of 'png_info {aka struct png_info_def}'
  In file included from a1.cpp:2:0:
  ./SImageIO.h:98:24: error: invalid use of incomplete type 'png_info {aka struct png_info_def}'
  In file included from ./SImageIO.h:21:0,
               from a1.cpp:2:
  /opt/local/include/png.h:566:16: error: forward declaration of 'png_info {aka struct png_info_def}'
  In file included from a1.cpp:2:0:
  ./SImageIO.h:99:28: error: invalid use of incomplete type 'png_info {aka struct png_info_def}'
  In file included from ./SImageIO.h:21:0,
               from a1.cpp:2:
  /opt/local/include/png.h:566:16: error: forward declaration of 'png_info {aka struct png_info_def}'
  In file included from a1.cpp:2:0:
  ./SImageIO.h:100:27: error: invalid use of incomplete type 'png_info {aka struct png_info_def}'
  In file included from ./SImageIO.h:21:0,
               from a1.cpp:2:
  /opt/local/include/png.h:566:16: error: forward declaration of 'png_info {aka struct png_info_def}'
  In file included from a1.cpp:2:0:
  ./SImageIO.h:113:43: error: invalid use of incomplete type 'png_info {aka struct png_info_def}'
  In file included from ./SImageIO.h:21:0,
               from a1.cpp:2:
  /opt/local/include/png.h:566:16: error: forward declaration of 'png_info {aka struct png_info_def}'
  In file included from ./SImage.h:4:0,
               from a1.cpp:1:
  ./DTwoDimArray.h: In instantiation of '_DTwoDimArray&lt;T&gt;&amp; _DTwoDimArray&lt;T&gt;::operator=(const _DTwoDimArray&lt;T&gt;&amp;) [with T = double]':
  ./SImage.h:9:7:   required from here
  ./DTwoDimArray.h:84:7: error: 'memcpy' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
  In file included from ./SImage.h:5:0,
               from a1.cpp:1:
   /usr/include/string.h:83:7: note: 'void* memcpy(void*, const void*, size_t)' declared here, later in the translation unit
  </code></pre>