compiling error: ELF file's phentsize not the expected size

mitsch dubreus at csit.fsu.edu
Tue Jun 11 11:45:59 EDT 2002


I try to wrapp c++ with python using the boost libraries.

but I got some errors, when trying to import the .so created.


Traceback (most recent call last):
  File "./boost.py", line 2, in ?
    import getting_started1
ImportError: ./getting_started1.so: ELF file's phentsize not the
expected size


can somebody help?



here's my compilation command:
g++3 getting_started1.cpp  -c -fPIC -shared  -o getting_started1.so
-I/usr/local/lib/python/boost_1_28_0/ -I /usr/include/python2.1/


here's my getting_started1.cpp file:
#include <boost/python/class_builder.hpp>
namespace python = boost::python;
#include <string>

namespace { // Avoid cluttering the global namespace.

  // A couple of simple C++ functions that we want to expose to
Python.
  std::string greet() { return "hello, world"; }
  int square(int number) { return number * number; }
}

BOOST_PYTHON_MODULE_INIT(getting_started1)
{
    // Create an object representing this extension module.
    python::module_builder this_module("getting_started1");

    // Add regular functions to the module.
    this_module.def(greet, "greet");
    this_module.def(square, "square");
}



More information about the Python-list mailing list