0
点赞
收藏
分享

微信扫一扫

pyd文件依赖python版本的解决方案

罗蓁蓁 2022-02-15 阅读 139

pyd

  • c使用swig、cpython
  • c++使用boost.python、pybind11(pip install pybind11)

pyd生成依赖python.h文件,里面包含pyconfig.h,最终生成的dll会产生对python(version).dll,而同时导入多个python.dll会导致python提示冲突

定义Py_LIMITED_API宏,使用python3.lib,python3.0以上版本通用,不过只适用于cpython,c的调用方式
在这里插入图片描述

ctypes

  • CDLL(“dll_name.dll”,winmode=0)加载dll,还有WINDLL、PYDLL
  • structure结构体封装
class T(structure):
举报

相关推荐

0 条评论