一.下载编译
1.下载wget http://downloads.sourceforge.net/freeimage/FreeImage3170.zip
2.解压unzip FreeImage3170.zip -d freeimage
3.编译 cd freeimage;make
二.bug总结
1.类型转换错误 int转char
错误信息:
Source/LibRawLite/./internal/dcraw_common.cpp:4545:3: error: narrowing conversion of ‘128’ from ‘int’ to ‘signed char’ inside { } [-Wnarrowing]
}, chood[] = { -1,-1, -1,0, -1,+1, 0,+1, +1,+1, +1,0, +1,-1, 0,-1 };
Source/LibRawLite/./internal/dcraw_common.cpp:2501:3: error: narrowing conversion of ‘-2’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]
};
解决方案:在makefile文件中添加CXXFLAGS += -Wno-narrowing,忽略narrowing警告,其中linux下默认makefile文件是Makefile.gnu。