compiling error: undefined symbol: __gxx_personality_v0
mitsch
dubreus at csit.fsu.edu
Tue Jun 11 11:32:24 EDT 2002
Hi,
I try to wrap C functions in Python.
when I compile, here's the result:
Traceback (most recent call last):
File "./boost.py", line 2, in ?
import getting_started1
ImportError: ./getting_started1.so: undefined symbol:
__gxx_personality_v0
can somebody tell why this error?
here's my files:
getting_stated!.cpp :
#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");
}
my compile command:
g++3 -fpic -g -I/usr/include/python2.1
-I/usr/local/lib/python/boost_1_28_0/ -c ./getting_started1.cpp
gcc -shared -lc getting_started1.o -o getting_started1.so
More information about the Python-list
mailing list