如何修复 'ft2build.h: No such file or directory'
如果你的编译器显示类似这样的构建错误:
build_error_ft2build.txt
/usr/include/opencascade/Font_FTLibrary.hxx:23:10: fatal error: ft2build.h: No such file or directory你缺少 libfreetype 的 ft2build.h 头文件。
为了在 Ubuntu 上安装它,使用
install_libfreetype.sh
sudo apt-get install libfreetype6-dev如果错误仍然存在,你可能想将 /usr/include/freetype2 添加到包含路径中。对于 GCC/G++,添加
freetype_include_flag.txt
-I/usr/include/freetype2到编译器的命令行参数中。
如果你使用 CMake,你可以在 CMakeLists.txt 中使用类似这样的行:
CMakeLists.txt
include_directories (/usr/include/freetype2)Check out similar posts by category:
C/C++
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow