zoukankan      html  css  js  c++  java
  • 编译freetype 的dll

    因需要给python使用freetype库,so需要一个freetype的dll

    2 steps

    1. 在VC中设置输出为动态链接库

    2. 修改ftoption.h

    在284行增加2行代码即可

      /*************************************************************************/
      /*                                                                       */
      /* DLL export compilation                                                */
      /*                                                                       */
      /*   When compiling FreeType as a DLL, some systems/compilers need a     */
      /*   special keyword in front OR after the return type of function       */
      /*   declarations.                                                       */
      /*                                                                       */
      /*   Two macros are used within the FreeType source code to define       */
      /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */
      /*                                                                       */
      /*     FT_EXPORT( return_type )                                          */
      /*                                                                       */
      /*       is used in a function declaration, as in                        */
      /*                                                                       */
      /*         FT_EXPORT( FT_Error )                                         */
      /*         FT_Init_FreeType( FT_Library*  alibrary );                    */
      /*                                                                       */
      /*                                                                       */
      /*     FT_EXPORT_DEF( return_type )                                      */
      /*                                                                       */
      /*       is used in a function definition, as in                         */
      /*                                                                       */
      /*         FT_EXPORT_DEF( FT_Error )                                     */
      /*         FT_Init_FreeType( FT_Library*  alibrary )                     */
      /*         {                                                             */
      /*           ... some code ...                                           */
      /*           return FT_Err_Ok;                                           */
      /*         }                                                             */
      /*                                                                       */
      /*   You can provide your own implementation of FT_EXPORT and            */
      /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */
      /*   will be later automatically defined as `extern return_type' to      */
      /*   allow normal compilation.                                           */
      /*                                                                       */
      /*   Do not #undef these macros here since the build system might define */
      /*   them for certain configurations only.                               */
      /*                                                                       */
    /* #define FT_EXPORT(x)      extern x */
    /* #define FT_EXPORT_DEF(x)  x */
    #define FT_EXPORT(x) __declspec(dllexport) x
    #define FT_BASE(x) __declspec(dllexport) x

    另外,生成的dll直接放入phthon.exe所在目录即可,无需放入system32下。

  • 相关阅读:
    晚上打死个老鼠
    今早服务器出现的问题
    打球
    出于对Atlas自带AutoCompleteBehavior的不满,自定义了一个支持模版的AutoCompleteBehavior
    PetShop4.0项目分解
    WebSnapr-生成你的网站缩略图
    Lost HTML Intellisense within ASP.NET AJAX Controls
    调整调出输入法的顺序
    儿童网址大全
    gridview列 数字、货币和日期 显示格式
  • 原文地址:https://www.cnblogs.com/zhangyonghugo/p/3904702.html
Copyright © 2011-2022 走看看