Boost logo

Boost Users :

From: dlrubin_at_[hidden]
Date: 2001-11-24 20:12:14


I'm getting a "refernced symbol not found" error when loading modules
compiled with Boost.

I tried using boost using this example code:
#include <stdio.h>
#include <string>
#include <boost/python/class_builder.hpp>

namespace {
  std::string greet() { return "hello, world"; }
  int square(int number) { return number * number; }
}

namespace python = boost::python;

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

    // Add regular functions to the module.
    this_module.def(greet, "greet");
  }
  catch(...)
  {
    python::handle_exception(); // Deal with the exception for Python
  }
}

and when I try importing into python, here's the error I get:

Python 2.1.1 (#5, Nov 22 2001, 14:04:45)
[GCC 2.95.2 19991024 (release)] on sunos5
Type "copyright", "credits" or "license" for more information.
>>> import example
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: ld.so.1: python: fatal: relocation error: file
./example.so: symbol handle_exception__Q25boost6pythonv: referenced
symbol not found

Any suggestions?
thanks,
Daniel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net