freetype/config/ftheader.h: No such file or directory

今天在linux编译工程时,碰到如下错误:

/opt/mv_pro_4.0.1/montavista/pro/devkit/arm/v5t_le/bin/../target/usr/include/ft2build.h:56:38: freetype/config/ftheader.h: No such file or directory
xxx/FreetypeUtils.cpp:8:10: #include expects "FILENAME" or <FILENAME>
xxx/FreetypeUtils.cpp:9:10: #include expects "FILENAME" or <FILENAME>
Compiling: xxx/SWJpegBuffer.cpp
xxx/FreetypeUtils.cpp:56: error: `FT_Library' does not name a type
xxx/FreetypeUtils.cpp:65: error: `FT_Face' does not name a type
xxx/FreetypeUtils.cpp:77: error: ISO C++ forbids declaration of `FT_Bitmap' with no type
xxx/FreetypeUtils.cpp:77: error: expected `;' before '*' token
xxx/FreetypeUtils.cpp: In function `int FT_Init()':
xxx/FreetypeUtils.cpp:100: error: `FT_Error' undeclared (first use this function)
xxx/FreetypeUtils.cpp:100: error: (Each undeclared identifier is reported only once for each function it appears in.)
xxx/FreetypeUtils.cpp:100: error: expected `;' before "error"
xxx/FreetypeUtils.cpp:101: error: `error' undeclared (first use this function)
xxx/FreetypeUtils.cpp:117: error: `g_library' undeclared (first use this function)
xxx/FreetypeUtils.cpp:117: error: `FT_Library_Version' undeclared (first use this function)
xxx/FreetypeUtils.cpp: In function `void FT_Quit()':
xxx/FreetypeUtils.cpp:133: error: `g_library' undeclared (first use this function)
xxx/FreetypeUtils.cpp:133: error: `FT_Done_FreeType' undeclared (first use this function)
xxx/FreetypeUtils.cpp: In function `void FT_CloseFont(FT_Font*)':
xxx/FreetypeUtils.cpp:147: error: 'struct _FT_Font' has no member named 'face'
xxx/FreetypeUtils.cpp:149: error: 'struct _FT_Font' has no member named 'face'
xxx/FreetypeUtils.cpp:149: error: `FT_Done_Face' undeclared (first use this function)
xxx/FreetypeUtils.cpp: In function `FT_Font* FT_OpenFont(const char*, int)':
xxx/FreetypeUtils.cpp:172: error: `FT_Face' undeclared (first use this function)
xxx/FreetypeUtils.cpp:172: error: expected `;' before "face"
xxx/FreetypeUtils.cpp:173: error: `FT_Error' undeclared (first use this function)
xxx/FreetypeUtils.cpp:173: error: expected `;' before "error"
xxx/FreetypeUtils.cpp:174: error: `FT_Fixed' undeclared (first use this function)
xxx/FreetypeUtils.cpp:174: error: expected `;' before "scale"
xxx/FreetypeUtils.cpp:184: error: `error' undeclared (first use this function)
xxx/FreetypeUtils.cpp:184: error: `g_library' undeclared (first use this function)
xxx/FreetypeUtils.cpp:184: error: 'struct _FT_Font' has no member named 'face'
xxx/FreetypeUtils.cpp:184: error: `FT_New_Face' undeclared (first use this function)
xxx/FreetypeUtils.cpp:191: error: `face' undeclared (first use this function)
xxx/FreetypeUtils.cpp:191: error: 'struct _FT_Font' has no member named 'face'
xxx/FreetypeUtils.cpp:194: error: `FT_ENCODING_UNICODE' undeclared (first use this function)
xxx/FreetypeUtils.cpp:194: error: `FT_Select_Charmap' undeclared (first use this function)
xxx/FreetypeUtils.cpp:203: error: `FT_IS_SCALABLE' undeclared (first use this function)
xxx/FreetypeUtils.cpp:207: error: `FT_Set_Char_Size' undeclared (first use this function)
xxx/FreetypeUtils.cpp:215: error: `scale' undeclared (first use this function)
xxx/FreetypeUtils.cpp:216: error: `FT_MulFix' undeclared (first use this function)
xxx/FreetypeUtils.cpp: In function `int FT_GetCharBitmap(FT_Font*, const short unsigned int*, unsigned char*, int, int, int, int, int&)':
xxx/FreetypeUtils.cpp:276: error: 'struct tagTEXT' has no member named 'bitmap'
xxx/FreetypeUtils.cpp:281: error: `FT_Bitmap' undeclared (first use this function)
xxx/FreetypeUtils.cpp:281: error: `bitmap' undeclared (first use this function)
xxx/FreetypeUtils.cpp:281: error: 'struct tagTEXT' has no member named 'bitmap'
xxx/FreetypeUtils.cpp:313: error: `FT_GlyphSlot' undeclared (first use this function)
xxx/FreetypeUtils.cpp:313: error: expected `;' before "slot"
xxx/FreetypeUtils.cpp:314: error: `FT_UInt' undeclared (first use this function)
xxx/FreetypeUtils.cpp:314: error: expected `;' before "glyph_index"
xxx/FreetypeUtils.cpp:315: error: `FT_Error' undeclared (first use this function)
xxx/FreetypeUtils.cpp:315: error: expected `;' before "error"
xxx/FreetypeUtils.cpp:316: error: `bm' undeclared (first use this function)
xxx/FreetypeUtils.cpp:324: error: `glyph_index' undeclared (first use this function)
xxx/FreetypeUtils.cpp:324: error: 'struct _FT_Font' has no member named 'face'
xxx/FreetypeUtils.cpp:324: error: `FT_Get_Char_Index' undeclared (first use this function)
Process terminated with status 1 (0 minutes, 21 seconds)
50 errors, 0 warnings
---------------------------------------------------------------------------
解决方法:

从错误提示信息不难看出是编译器找不到相应的头文件,
我们在工程的搜索目录中添加freetype2的头文件所在目录即可:
如我的freetype2头文件所在目录为:
/opt/mv_pro_4.0.1/montavista/pro/devkit/arm/v5t_le/target/usr/include/freetype2















  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
根据引用所提供的信息,当编译hello world程序时,出现了"main.c:3:10: fatal error: test.h: No such file or directory"的错误。这个错误表明编译器无法找到"test.h"头文件。 为了解决这个问题,你可以按照引用所给出的方法,通过设置环境变量来告诉编译器头文件的位置。 你可以使用以下命令设置C_INCLUDE_PATH和CPLUS_INCLUDE_PATH环境变量: ``` export C_INCLUDE_PATH=[你的头文件的位置] export CPLUS_INCLUDE_PATH=[你的头文件的位置] ``` 将"[你的头文件的位置]"替换为实际的test.h头文件所在的路径。然后重新编译你的程序,应该就能成功找到test.h头文件并解决这个错误了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [fatal error: stdio.h: No such file or directory](https://blog.csdn.net/BenRenYiGuaShi/article/details/116646720)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [linux全志R16的linux系统编译的资料_20170502_1655.7z](https://download.csdn.net/download/wb4916/9831266)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [编译错误 freetype.c:14:10: fatal error: ft2build.h: No such file or directory](https://blog.csdn.net/qq_54508596/article/details/125639989)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

friendan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值