gpt4 book ai didi

c++ - fatal error : freetype/config/ftheader. h

转载 作者:太空狗 更新时间:2023-10-29 20:02:49 25 4
gpt4 key购买 nike

我正在尝试使用 freeglut2 在 OpenGL 中渲染文本。当我包含以下 header 时,

#include <freetype2/ft2build.h>

它给出了以下错误:

/usr/local/include/freetype2/ft2build.h:37:38: fatal error: freetype/config/ftheader.h: No such file or directory

但是当我去 /usr/local/include/freetype2/freetype/config ,我找到了文件 ftheader.h。

请帮我解决这个问题。谢谢。

我去了this但没有任何效果。

最佳答案

您的编译器在 /usr/local/include 中搜索 include,因此当您这样做时:

#include <freetype2/ft2build.h>

它找到 /usr/local/include/freetype2/ft2build.h

但是这个文件试图包含 freetype/config/ftheader.h 但没有

/usr/local/include/freetype/config/ftheader.h

但是

/usr/local/include/freetyp2/freetype/config/ftheader.h

所以你应该将 -I/usr/local/include/freetyp2 传递给你的编译器并做一个

#include <ft2build.h>

是正确的。

如果您的系统支持 - 使用 pkg-config 实用程序,它可以提供所有编译标志,例如:

$ pkg-config --cflags freetype2
-I/usr/include/freetype2

$ pkg-config --libs freetype2
-lfreetype

关于c++ - fatal error : freetype/config/ftheader. h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34910660/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com