ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ctypes-users
ctypes-users
Re: [ctypes-users] LoadLibrary fails with libglut.so on linux
by Mike C. Fletcher other posts by this author
Oct 25 2005 9:54AM messages near this date
[ctypes-users] LoadLibrary fails with libglut.so on linux | Re: [ctypes-users] LoadLibrary fails with libglut.so on linux
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



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
ctypes-users mailing list
ctypes-users@[...].net
https://lists.sourceforge.net/lists/listinfo/ctypes-users
Thread:
Leonard "paniq" Ritter
Mike C. Fletcher
Thomas Heller
Leonard "paniq" Ritter
Leonard "paniq" Ritter
Leonard "paniq" Ritter
Leonard "paniq" Ritter
Leonard "paniq" Ritter
Leonard "paniq" Ritter
Leonard "paniq" Ritter

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved