ubuntu编译opencv时遇到libharfbuzz.so.0: undefined reference to `FT_Reference_Face'错误

今天在我的ubuntu16.04上编译opencv-3.4.* 时,发现如下错误:

//usr/lib/i386-linux-gnu/libharfbuzz.so.0: undefined reference to `FT_Reference_Face'
collect2: error: ld returned 1 exit status
modules/highgui/CMakeFiles/opencv_test_highgui.dir/build.make:104: recipe for target 'bin/opencv_test_highgui' failed
make[2]: *** [bin/opencv_test_highgui] Error 1
CMakeFiles/Makefile2:4937: recipe for target 'modules/highgui/CMakeFiles/opencv_test_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

提示找不到“FT_Reference_Face”,谷歌之,发现它是 freetype 库的内容。因此怀疑我的 freetype 版本较旧,于是下载 freetype-2.10.0.tar,输入以下命令安装:

# tar xf freetype-2.10.0.tar
# cd freetype-2.10.0
# mkdir build
# cd build
# ../configure --prefix=/usr/local
# make
...
# make install

然后再编译 opencv,发现一切正常了。

阅读更多:   杂谈
添加新评论

icon_redface.gificon_idea.gificon_cool.gif2016kuk.gificon_mrgreen.gif2016shuai.gif2016tp.gif2016db.gif2016ch.gificon_razz.gif2016zj.gificon_sad.gificon_cry.gif2016zhh.gificon_question.gif2016jk.gif2016bs.gificon_lol.gif2016qiao.gificon_surprised.gif2016fendou.gif2016ll.gif