[C++-sig] Linker errors with VC7.1 (.NET) and Python.Boost 1.31.0

Igor Lapshin igor at pcigeomatics.com
Wed Jun 2 17:39:58 CEST 2004


Hi, 

 

I'm trying to compile the following code within  MS Visual Studio IDE
.NET 2003. I compiled Boost 1.31.0 usign bjam, but I have the
requirement that all exposed into Python classes must be compiled within
IDE. "no_init" was specified because the original class has pure virtual
functions, but I get the same errors even without them. The original
class links and works fine on Linux/gcc, so I suppose I have problems
specific to VC7.1 and Windows.


class myclass 
{
    const char* name;

public:
    myclass();
    const char* getName();
};

myclass::myclass(): name("I'm a class") 
{}

const char *myclass::getName()
{ 
return name; 
}

using namespace boost::python;
BOOST_PYTHON_MODULE(testme)
{
  class_<myclass,boost::noncopyable>("myclass", no_init)
 .def("getName", &myclass::getName)
 ;
}

I specified libboost_python-vc71-mt-gd.lib as link library.

 

test_boost.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) void __cdecl
boost::python::objects::register_dynamic_id_aux(struct
boost::python::type_info,struct std::pair<void *,struct
boost::python::type_info> (__cdecl*)(void *))"
(__imp_?register_dynamic_id_aux at objects@python at boost@@YAXUtype_info at 23@P
6A?AU?$pair at PAXUtype_info@python at boost@@@std@@PAX at Z@Z) referenced in
function "void __cdecl boost::python::objects::register_dynamic_id<class
myclass>(class myclass *)"
(??$register_dynamic_id at Vmyclass@@@objects at python@boost@@YAXPAVmyclass@@
@Z)

 

Am I missing something? Do I always need to write a wrapper class for
"no_init"? 

Thanks, 

Igor

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20040602/78a97008/attachment.htm>


More information about the Cplusplus-sig mailing list