Skip to content

Instantly share code, notes, and snippets.

@xiongjia
Last active March 23, 2021 15:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiongjia/5f0c461dd4ff4984426026e9c0cb0649 to your computer and use it in GitHub Desktop.
Save xiongjia/5f0c461dd4ff4984426026e9c0cb0649 to your computer and use it in GitHub Desktop.
Building freetype2 on Windows #devnotes

Purpose

Building the freetype Windows 32 DLL & LIB for the Windows OpenJDK Compiling.

Get the freetype source code

Updating the Freetype Visual Studio solution settings

The default Windows building VS solution is "/builds/windows/vc2010/freetype.sln" (I built it via Visual Studio 2015).
The default VS solution and source code are created for static library. We need update below 2 items for change it to .DLL:

  • The project config and the General tab, change configuration type to "Dynamic Library (.dll)".
    NOTES: Select your configuration to "Release Multithread" + "Windows 32" first.
  • The default freetype Windows code is created for static library. We need change the dll export declare macro in the .h file.
    For freetype-2.3.5: The file is "ftconfig.h". Below items need to update:
    • Change FT_EXPORT to #define FT_EXPORT(x) __declspec(dllexport) x
    • Change FT_BASE to #define FT_BASE(x) __declspec(dllexport) x

Building the freetype

  • Select the "Release Multithread" + "Windows 32" configuration and build it.
  • The default output folder is "/objs/win32/vc2010"

References

@dafienko
Copy link

thank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment