我正在使用MAC OS Snow Leopard,并尝试编译我的程序a1.cpp,但我似乎遇到链接libpng的问题。这是我的问题吗?如果不是,那是什么?而且,我该如何解决它? 提前致谢
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&, SDoublePlane&, SDoublePlane&)':
./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<T>& _DTwoDimArray<T>::operator=(const _DTwoDimArray<T>&) [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