相关疑难解决方法(0)

静态库的ctypes?

我试图编写扑克牌-EVAL,AC静态库中的Python包装.所有我能找到的ctypes的文件表明,它适用于共享/动态库.是否有静态库的ctypes?

我知道用Cython,但我应该使用或重新编译扑克-EVAL成一个动态库,以便我可以使用ctypes的?

谢谢,

麦克风

python ctypes static-libraries

13
推荐指数
1
解决办法
9436
查看次数

python加载静态库

我在加载 dll 时遇到了一个新问题。我在加载带有“.so”、“.dll”扩展名的 dll 时没有任何问题。现在我对带有“.a”扩展名的 dll 有一些问题。它是一个静态库。下面是我的代码

Security_dll = ctypes.cdll.LoadLibrary("./staticlibraryname.a")
Run Code Online (Sandbox Code Playgroud)

顺便说一句,我的 os env 是一个 linux open suse。当我尝试这样做时,我得到的确切错误消息是:

File "module3.py", line 3, in <module>
Security_dll = ctypes.cdll.LoadLibrary("./libSecurityProductionStaticlib.a")
File "/usr/lib64/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
return self._dlltype(name)
File "/usr/lib64/python2.7/ctypes/__init__.py", line 362, in __init__
self._handle = _dlopen(self._name, mode)
OSError: ./libSecurityProductionStaticlib.a: invalid ELF header
Run Code Online (Sandbox Code Playgroud)

python linux dll

0
推荐指数
1
解决办法
4087
查看次数

标签 统计

python ×2

ctypes ×1

dll ×1

linux ×1

static-libraries ×1