Jump to content
  • Advertisement
Sign in to follow this  

Problems creating an OpenGL based Python module

This topic is 5415 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:
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
I think you will need to add opengl as the libraries parameter. Check the distutils docs for how to do this.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!