Error:ImageIOpng.cpp:(.text+0x5b9): undefined reference to `png_create_write_struct'等

编译MRF-benchmark的时候,刚开始没安装libpng,直接用的代码提供/imageLib/lpng文件夹里面的libpng库,把它拷到了/imageLib/下面,后面自己又重新安装了zlib和libpng,导致在make的时候链接libpng的时候程序不知道该链接哪一个,所以出现了以下的错误:

../imageLib/libImg.a(ImageIOpng.o): In function `WriteFilePNG(CImageOf<unsigned
char>, char const*)':
ImageIOpng.cpp:(.text+0x5b9): undefined reference to `png_create_write_struct'
ImageIOpng.cpp:(.text+0x5ce): undefined reference to `png_create_info_struct'
ImageIOpng.cpp:(.text+0x5ec): undefined reference to `png_init_io'
ImageIOpng.cpp:(.text+0x652): undefined reference to `png_set_IHDR'
ImageIOpng.cpp:(.text+0x668): undefined reference to `png_write_info'
ImageIOpng.cpp:(.text+0x675): undefined reference to `png_set_bgr'
ImageIOpng.cpp:(.text+0x6e1): undefined reference to `png_write_image'
ImageIOpng.cpp:(.text+0x6f7): undefined reference to `png_write_end'
ImageIOpng.cpp:(.text+0x70b): undefined reference to `png_destroy_write_struct'

后面我把自带的lpng删掉,用自己安装的库来链接,这个错误就解决了。

你可能感兴趣的:(Error:ImageIOpng.cpp:(.text+0x5b9): undefined reference to `png_create_write_struct'等)