在 ubuntu 16 上设置 header 个文件夹编译 opencv 3

Setting header file folders compiling opencv 3 on ubuntu 16

我在 ubuntu16 中尝试编译 opencv 3 时遇到了一些问题。 我已经关注 opencv tutorial 并解决了有关该问题的问题,但无法解决问题。

我的问题是编译过程找不到 header 个文件。 当我执行 make -j4 时,进程结束并出现错误。

/opencv/build/modules/freetype/precomp.hpp:61:22: 致命错误: ft2build.h: 文件或目录不存在 编译终止。

此文件位于以下目录中:

/xxx/tools/anaconda3/pkgs/freetype-2.5.5-1/include/freetype2/ft2build.h
/xxx/anaconda3/include/freetype2/ft2build.h
/home/xxx/anaconda3/envs/computervision/include/freetype2/ft2build.h
/usr/include/freetype2/ft2build.h

我尝试使用 -I 参数将 /user/include/freetype2 设置为 header 文件夹,但没有成功:

make -j4 -I/usr/include/harfbuzz

谁能给我一些关于如何设置 header 文件夹的提示?

谢谢。

我终于解决了这个问题,只需将此参数添加到 cmake:

-D ENABLE_PRECOMPILED_HEADERS=OFF