Ich habe ein System mit Python Version 2.6.5 und 2.7.1 und ich merke, dass eine LoadLibrary funktioniert, die andere nicht .Python ctypes.cdll.LoadLibrary funktioniert anders zwischen 2.6.5 und 2.7.1
Python 2.7.1 (r271:86832, Nov 30 2010, 10:03:07)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import cdll
>>> cdll.LoadLibrary("./mylib.so")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/ctypes/__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "/usr/local/lib/python2.7/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: ./mylib.so: undefined symbol: compress2
und 2.6.5 Land in Arbeit:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import cdll
>>> cdll.LoadLibrary("./mylib.so")
<CDLL './mylib.so', handle 98bbd88 at b785c94c>
Kennt jemand ein guter Weg, um herauszufinden, warum Python 2.7.1 funktioniert nicht?
Ich habe festgestellt, dass ich das hier erstellte Beispiel [link] (http://wolfprojects.altervista.org/articles/dll-in-c-for-python/) laden kann, wenn ich ctypes.windll.LoadLibrary verwende aber nicht ctypes.cdll.LoadLibrary. Ähnlich wie bei Ihrem Problem. Python 2.7.1 unter Windows 7. – DangerMouse