|
Boost : |
From: Adrien Hernot (amh_at_[hidden])
Date: 2001-03-30 05:20:05
Hi!
I have link-time error when compiling the folowing code:
#include "test.h"
boost::python::class_builder<test> test_class(hello, "test");
test_class.def(boost::python::constructor<>());
test_class.def(&test::f1, "f1");
with test.h containing:
class test {
public:
test() {};
void f1(int) {};
};
The errror message line broken by me (from MSVC6):
hello.obj : error LNK2001: unresolved external symbol "class test & __cdecl
from_python(struct _object *,struct boost::python::type<class test &>)"
(?from_python@@YAAAVtest@@PAU_object@@U?$type_at_AAVtest@@@python_at_boost@@@Z)
BUT it appears that adding an non void constructor to test.h
and augmenting the wrapper accordingly:
test(int) {}
and
test_class.def(boost::python::constructor<int>());
will link correctly.
I tried to have a look the BPL source, with no success.
Has someone an explanation for this behaviour ?
regards,
Adrien Hernot
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk