编译freetype 的dll
2024-08-31 20:46:14
因需要给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下。
最新文章
- Codeforces Round #383 (Div. 1)
- FPGA基本原理之一
- MString 与 QString 互转
- php 信号量
- ASP.NET读取配置文件发送邮件
- 【转】你真的了解iOS代理设计模式吗?
- inet_aton等函数
- R包——ggplot2(二)
- KindEditor - 代码高亮
- C# 几种方法来复制的阵列
- 编程算法基础-数字数码管-隐藏password
- zkw费用流
- NS3网络仿真(10): 解析以太网帧
- Python爬虫入门教程 26-100 知乎文章图片爬取器之二
- 获取多<;a/>;标签id值的点击事件
- thinkphp5 上传服务器后 Access denied
- linux 目录/sys 解析
- sap 创建odata服务,通过http向数据库 进行增删改查
- 如何合并ts文件?
- 各种linux小操作