• Advertisement


  • Content count

  • Joined

  • Last visited

Everything posted by joeG

  1. Graphics Survey

    It took me about 8 tries to get something other than a type 0 map.
  2. Bevo Burgers

    Link: 5th year in a row! Boomer Sooner!
  3. Bevo Burgers

    We'll have to wait and see. You guys have done well in the past few years, so there's no reason to overlook you guys.
  4. linking python libs in linux

    Here's the bits from an autoconf project that is more or less what you're asking for. The result is a C++ executable that starts a Python interpreter and dynamically loads (via Python) a C++ Python extension that exposes all the engine to the Python users (which is mainly scripting, game logic and AI). The key bits are in the configure.in listing where you get the linking flags from a python script via the package distutils. Makefile.am that builds the executable AM_CXXFLAGS=@CPPUNIT_CFLAGS@ -I../../src -I../../bindings/python -I../src @PYTHON_CXXFLAGS@ LDADD=@CPPUNIT_LIBS@ ../../src/libengine.la ../../bindings/python/libpyengine.la LDFLAGS= @PYTHON_LDFLAGS@ -export-dynamic from configure.in at the top-level AM_PATH_PYTHON("2.2") AC_CHECK_HEADER( python${PYTHON_VERSION}/Python.h, PYTHON_CXXFLAGS=-I/usr/include/python${PYTHON_VERSION}, AC_MSG_ERROR(the Game needs the Python headers to build)) AC_SUBST(PYTHON_CXXFLAGS) AC_SUBST([PYTHON_LDFLAGS], [`${PYTHON} -c "import distutils.sysconfig s= distutils.sysconfig.get_config_var('LINKFORSHARED') if(s is not None): print s"` ] )
  5. Let me try this thread again in a better forum... My game engine is typical of today's games; logic is going to be written in Python, the rendering code in C++. All is pretty much done (except a lot of real testing of the Python binding), except one tiny problem :-) The main application deserializes an object from a file and then sends it back to the caller which happens to be some code in the Python extension module. Any attempt to read from that data results in a segmentation fault. I tried an experiment with one of the C++ classes that was declared and defined in the header file and all went well ( I could read from the data sent from the application). Therefore I suspect that the problem is with the symbol table of the module not being properly loaded when the module is dlopen'd. A look at the symbols in the Python extension reveals that the vtable was defined for the class that worked, but not so for the other classes that I tried. So I guess the question is: "How does one ensure that the module gets a copy of the symbol table from the application?" Thanks for your time,
  • Advertisement