【问题】关于FreeType2的使用_使用时各种编译错误

AntiMoron 2014-04-08 08:37:51
大家好。我是自己用dx11做3D引擎的爱好者。
最近着手制作font engine.这一步我跳过很久了,调试信息的输出以前一直都是通过allocConsole并重定向的方式
在我考虑用什么东西将true type字体解析到一个纹理上时,发现free type是不错的选择,不过发生了一些问题。

描述:
在使用free type时发生如下一系列错误。

//使用的代码
#include <ft2build.h>
#include FT_FREETYPE_H

int main()
{
;
return 0;
}

错误信息如下
1>  Source.cpp
1>c:\program files (x86)\windows kits\8.1\include\shared\fttypes.h(38): error C2146: syntax error : missing ';' before identifier 'FT_LOGICAL_DISK_ID'
1>c:\program files (x86)\windows kits\8.1\include\shared\fttypes.h(38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\freetype-2.5.3\include\fterrdef.h(35): error C2143: syntax error : missing '}' before '('
1>d:\freetype-2.5.3\include\fterrdef.h(35): error C2143: syntax error : missing ';' before '<L_TYPE_raw>'
1>d:\freetype-2.5.3\include\fterrdef.h(35): error C2059: syntax error : '<L_TYPE_raw>'
1>d:\freetype-2.5.3\include\fterrors.h(164): error C2143: syntax error : missing ';' before '}'
1>d:\freetype-2.5.3\include\fterrors.h(177): error C2059: syntax error : '}'
1>d:\freetype-2.5.3\include\fterrors.h(177): error C2143: syntax error : missing ';' before '}'
1>d:\freetype-2.5.3\include\freetype.h(38): error C2143: syntax error : missing ';' before '{'
1>d:\freetype-2.5.3\include\freetype.h(38): error C2447: '{' : missing function header (old-style formal list?)
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:04.59
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


我的参考资料如下:
http://www.freetype.org/freetype2/docs/tutorial/step1.html

开发环境 VS2013
操作系统 win7
freetype版本:http://sourceforge.net/projects/freetype/files/
下载的freetype_253
静态lib 在vs2013下对release 和debug版本分别进行了build.
生成文件如下:http://pan.baidu.com/s/1sj76RP7


最后, 俺在等大神们精彩的回答。 新手只有100分
...全文
766 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
AntiMoron 2014-04-08
  • 打赏
  • 举报
回复
up up up
FrankHB1989 2014-04-08
  • 打赏
  • 举报
回复
引用 3 楼 FrankHB1989 的回复:
不就是头文件路径冲突了嘛。 任选: 1.把Windows SDK扔出包含路径。 2.包含FreeType源码。 3.改名,然后手动找到ftconfig.h里面对应的宏改掉。
最后一个记错了。是ft2build.h或者config/ftheader.h。 (不过虽然理论可行一般还是不要改的好。)
FrankHB1989 2014-04-08
  • 打赏
  • 举报
回复
不就是头文件路径冲突了嘛。 任选: 1.把Windows SDK扔出包含路径。 2.包含FreeType源码。 3.改名,然后手动找到ftconfig.h里面对应的宏改掉。

65,208

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧