Sign in to follow this  

Problems creating an OpenGL based Python module

This topic is 4832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on a C based module for python using OpenGL. The code basicly wraps some vertex buffer code, and I made sure not to use any OpenGL extention libraries. I've created a setup.py (below).
from distutils.core import setup, Extension

module1 = Extension('PyGame3D',
                    sources = ['primitiveobject.cpp'])

setup (name = 'PyGame3D',
       version = '1.0',
       description = 'Extentions for PyGame',
       ext_modules = [module1])
My C code (primitiveobject.cpp) compiles just fine, but when setup.py invokes the linker, it says it cannot find the OpenGL functions. I've cut and pasted the output below.
running install
running build
running build_ext
building 'PyGame3D' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c primitiveobject.cpp -o build/temp.darwin-7.5.0-Power_Macintosh-2.3/primitiveobject.o
creating build/lib.darwin-7.5.0-Power_Macintosh-2.3
c++ -Wl,-F. -Wl,-F. -bundle -framework Python build/temp.darwin-7.5.0-Power_Macintosh-2.3/primitiveobject.o -o build/lib.darwin-7.5.0-Power_Macintosh-2.3/PyGame3D.so
ld: warning -prebind has no effect with -bundle
ld: Undefined symbols:
_glColorPointer
_glDrawElements
_glNormalPointer
_glTexCoordPointer
_glVertexPointer
error: command 'c++' failed with exit status 1

I use Mac OS 10.3, and the gcc compiler. Thanks for your help.

Share this post


Link to post
Share on other sites

This topic is 4832 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this