受到下面这篇文章启发,但是在做的过程中遇到了一些bug,所以我重新整理一下实现步骤

http://blog.csdn.net/aucaser/article/details/49963049?utm_source=itdadao&utm_medium=referral

一 配置freetype 

1. 在下面这个两个网站里下载 freetype-2.3.4和 ftgl-2.1.3-rc5

http://download.savannah.gnu.org/releases/freetype/

https://sourceforge.net/projects/ftgl/

Freetype 与 OpenGL 合作显示中文(Unicode) Visual StudioFreetype 与 OpenGL 合作显示中文(Unicode) Visual Studio(里面有很多版本,但是哪个都可以啦)

2. 在目录C:\Users\Dell\Downloads\freetype-2.3.4\builds\win32\visualc下,用visual studio打开freetype.sln(如果你用的是比较高的版本,比如我的是2015,它就会提示说这个版本不一啊,balabla的,不用管,就继续打开就好)

打开之后,你就build一下,就会在目录C:\Users\Dell\Downloads\freetype-2.3.4\objs下出现一个Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio

然后把它复制到这个目录下,也就是你visual studio的安装目录下C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib

再把这个目录下C:\Users\Dell\Downloads\freetype-2.3.4\include 的该文件夹Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio拷贝到C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include

3. 接下来来到ftgl了!

在此目录下C:\Users\Dell\Downloads\ftgl-2.1.3~rc5\msvc\vc8打开Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio

再build一下之后,请来到C:\Users\Dell\Downloads\ftgl-2.1.3~rc5\msvc\Build,在里面把Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studioand Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio拷贝到

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib

再来到C:\Users\Dell\Downloads\ftgl-2.1.3~rc5\src下,把FTGL文件夹拷贝到C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include

以上!!就是我参考的文章之后做的行动。我也用了该篇文章提到的例子,但是接下来出现了一些编译错误。然后我进行了如下的行动。Follow me!


我先自己创建了一个项目,叫ftgldemo.然后把我开篇提的文章里面的例子放进去了。

接下来

1. 点击Project----->ftgldemo Properties就来到了这个界面。然后请点击Linker---->Input. 注意观察Additional Dependencies这个地方

请在里面添加: freetype234_D.lib;ftgl_D.lib; 这个很重要

Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio

2. 请来到这里:C:\Users\Dell\Downloads\ftgl-2.1.3~rc5\msvc\Build

Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio拷贝到C:\Windows\System32

你是32位系统就拷贝到System32,如果是64位系统就拷贝到SysWOW64

3. 请把代码中的Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio这部分,修改成 #include <FTGL/ftgl.h>

二 配置OpenGL

需要先下载库文件,这个网上都有。然后配置方法如下:(英文的原因是当时要给老板(外国人)写配置过程。很简单的,所以就不翻译了哈)

1.create a new file "GL" in the path:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\GL
then put glut.h in the GL file.
2. Put glut32.lib int the path: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib
3. Put glut32.dll int the path:C:\Windows\System32

最后,如果编译成功,运行之后的样子是:

 

Freetype 与 OpenGL 合作显示中文(Unicode) Visual Studio

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-06-23
  • 2022-02-20
  • 2022-01-07
  • 2022-12-23
猜你喜欢
  • 2021-11-26
  • 2021-10-26
  • 2021-07-05
  • 2022-01-23
  • 2021-12-13
  • 2021-06-21
  • 2022-01-20
相关资源
相似解决方案