Panda3d and cython- problems

Return to Scripting Issues

Panda3d and cython- problems

Postby Freakazo » Tue Feb 15, 2011 2:46 am

The blog entry provides an example on how to use cython with panda3d. I had to change the setup.py to this to work on linux, the test.pyx remains the same:

Code: Select all
from Cython.Distutils import build_ext
from distutils.core import setup
from distutils.extension import Extension
import sys

# make setup do what we want,
# build extension modules in place
sys.argv.append('build_ext')
sys.argv.append('--inplace')

setup(
    cmdclass={'build_ext': build_ext},
    ext_modules=[Extension("helloworld", ["Test.pyx"], include_dirs=["/usr/include/panda3d"], language="c++")])


and I have this script to import and run it.

Code: Select all
import panda3d
from panda3d.core import Vec3
from panda3d.core import Geom
import Test
print("Hi")


But I get the error:
Code: Select all
ImportError: /media/Storage/Dokumente/Programeering/Cython Testing/src/Test.so: undefined symbol: _ZTI11TypedObject


I noticed in the blog entry another user had the same problem (This one) But he still doesn't have an answer.

I'm on linux with cython0.14. Any help would be appreciated.
Be not the herp inside the derp
Freakazo
 
Posts: 11
Joined: Wed Aug 11, 2010 10:48 pm
Location: South Africa

Postby treeform » Tue Feb 15, 2011 3:02 pm

Its a C++ linking problem check out the C++ section. My guess is that there is a version missmatch some place.
User avatar
treeform
 
Posts: 2106
Joined: Sat May 05, 2007 5:15 pm
Location: SF, CA

Postby dimfish » Fri May 04, 2012 8:03 am

You need to inform the linker which modules to link against. In the provided setup.py this can be done by adding

Code: Select all
args['libraries']=['p3framework', 'panda', 'pandafx', 'pandaexpress', 'p3dtoolconfig', 'p3dtool', 'p3pystub', 'p3direct']


before the compilation happens.
dimfish
 
Posts: 2
Joined: Mon Apr 16, 2012 7:06 am


Return to Scripting Issues

Who is online

Users browsing this forum: No registered users and 1 guest