Invalid use of incomplete type ‘struct png_info’

Hello!

Another compilation problem when trying to build Cellprofiler under Linux:

================================================
building ‘matplotlib._png’ extension
gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include -I/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include -I/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include -I/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/libpng15 -I/usr/local/include -I/usr/include -I. -I/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/lib/python2.6/site-packages/numpy/core/include -I. -I/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/python2.6 -c src/_png.cpp -o build/temp.linux-x86_64-2.6/src/_png.o
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
src/_png.cpp: In member function ‘Py::Object _png_module::read_png(const Py::Tuple&)’:
src/_png.cpp:353:33: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
src/_png.cpp:354:34: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
src/_png.cpp:356:29: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
src/_png.cpp:364:18: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
src/_png.cpp:377:17: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
src/_png.cpp:383:17: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
src/_png.cpp:411:17: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
src/_png.cpp:415:22: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
src/_png.cpp:424:30: error: invalid use of incomplete type ‘struct png_info’
/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/include/png.h:695:16: error: forward declaration of ‘struct png_info’
error: command ‘gcc’ failed with exit status 1
make: *** [/bubo/home/h20/eliasr/slask/cellprofiler20111018/eliasinstdir/lib/python2.6/site-packages/matplotlib-1.0.1-py2.6.egg-info] Error 1
[eliasr@q331 cellprofiler20111019]$

So it says “error: invalid use of incomplete type ‘struct png_info’” when trying to compile the file src/_png.cpp, apparently part of the ‘matplotlib._png’ extension.
Any ideas on how to get around this?

(Compiler: gcc version 4.5.3.)

Elias
UPPMAX

Now that I tried building again using the new Makefile.CP2 posted by LeeKamentsky here


the problem with “invalid use of incomplete type ‘struct png_info’” did not appear. So perhaps it was just a result of using a bad/old makefile.
/ Elias