Re: [ctypes-users] LoadLibrary fails with libglut.so on linux
Brought to you by:
theller
From: Mike C. F. <mcf...@ro...> - 2005-10-25 16:52:47
|
Leonard "paniq" Ritter wrote: >given this minimal reproduce: > >from ctypes import * >glut = cdll.LoadLibrary('libglut.so') > >i get following error: > >Traceback (most recent call last): > File "glut.py", line 20, in ? > glut = cdll.LoadLibrary('libglut.so') > File "/usr/lib/python2.4/site-packages/ctypes/__init__.py", line 415, >in LoadLibrary > return self._dlltype(name) > File "/usr/lib/python2.4/site-packages/ctypes/__init__.py", line 319, >in __init__ > self._handle = _LoadLibrary(self._name) >OSError: /usr/X11R6/lib/libglut.so: undefined symbol: XFreePixmap > >supposedly a few other modules have to be loaded before libglut, but >even loading those (i got the other required modules by doing an ldd on >the _GLUT.pyd from the pyopengl distribution) wont make the error go >away. > >anyone has an idea whats wrong? > > You need to load the dependencies with the global loading flag. This will require a CVS version of ctypes: GL = OpenGL = ctypes.CDLL( ctypes.util.find_library('GL'), mode=ctypes.RTLD_GLOBAL ) GLU = ctypes.CDLL( ctypes.util.find_library('GLU'), mode=ctypes.RTLD_GLOBAL ) # glut shouldn't need to be global, but just in case a dependent library makes # the same assumption GLUT does... GLUT = ctypes.CDLL( ctypes.util.find_library('glut'), mode=ctypes.RTLD_GLOBAL ) GLE = ctypes.CDLL( ctypes.util.find_library('gle'), mode=ctypes.RTLD_GLOBAL ) HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |