小编zoo*_*ert的帖子

ctypes加载具有依赖关系的ac共享库

在Linux上,我有一个依赖于其他库的交流共享库.正确设置LD_LIBRARY_PATH以允许链接器加载所有库.当我做:

libgidcwf    = ctypes.cdll.LoadLibrary(libidcwf_path)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Traceback (most recent call last):
  File "libwfm_test.py", line 12, in <module>
    libgidcwf    = ctypes.cdll.LoadLibrary(libidcwf_path)
  File "/usr/lib/python2.5/ctypes/__init__.py", line 431, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.5/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: path-to-my-lib/libwav.so: undefined symbol: ODBCGeneralQuery
Run Code Online (Sandbox Code Playgroud)

看来LD_LIBRARY_PATH在这里没有效果.有没有办法让这些依赖库"可加载"?

在此先感谢您的帮助.

python linux ctypes

23
推荐指数
5
解决办法
2万
查看次数

标签 统计

ctypes ×1

linux ×1

python ×1