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下。

  • 相关阅读:
    今天碰到的angular 中的一个小坑
    mvc 防止客服端多次提交
    自定义通用Distinct去除重复数据的2中方式
    Sql 字符串操作类COALESCE
    SQL Server 性能优化
    Visual Studio Tip: Get Public Key Token for a Strong Named Assembly
    C#发送邮件
    Web打印组件jatoolsPrinter(转载)
    SQL SERVER 2005 同步复制技术(转)
    [Asp.net]常见word,excel,ppt,pdf在线预览方案(转)
  • 原文地址:https://www.cnblogs.com/zhangyonghugo/p/3904702.html
Copyright © 2011-2022 走看看