fetch公司的项目进行编译,此项目依赖opencv库。因为本人一直比较偏心fedora,但也所以给我带来了许多"乐趣"(麻烦)。fedora一直走得比较前沿,g++ 6.3了,因而在编译的过程当中遇到了一些错误,在此记录一下:fetch
/home/hiscene/Downloads/opencv-2.4.8.3/modules/contrib/src/chamfermatching.cpp:969:30: error: the compiler can assume that the address of ‘annotate_img’ will never be NULL [-Werror=address]
if (&annotate_img!=NULL) {
^
/home/hiscene/Downloads/opencv-2.4.8.3/modules/contrib/src/chamfermatching.cpp:1016:34: error: the compiler can assume that the address of ‘annotate_img’ will never be NULL [-Werror=address]
if (&annotate_img!=NULL) {
^
/home/hiscene/Downloads/opencv-2.4.8.3/modules/contrib/src/chamfermatching.cpp: In member function ‘cv::ChamferMatcher::Match* cv::ChamferMatcher::Matching::localChamferDistance(cv::Point, cv::Mat&, cv::Mat&, cv::ChamferMatcher::Template*, float)’:
/home/hiscene/Downloads/opencv-2.4.8.3/modules/contrib/src/chamfermatching.cpp:1111:25: error: the compiler can assume that the address of ‘orientation_img’ will never be NULL [-Werror=address]ui
在网上搜罗了一些答案:spa
cc1: warnings being treated as errors
AM_CFLAGS = -Wall -g $(MATCHBOX_PANEL_CFLAGS) \
-I$(top_srcdir) -I$(top_builddir) -Werrorio
说是把 -Werror 去掉编译
可是opencv是依赖cmake编译的,因而根据报错信息进入到了相应的目录,在flags.make文件里面找到了-Werror=address,将其去掉,而后保存,从新编译后就成功了。opencv