Boost function call error
I have made a .cpp file with boost_python_module inside it and a function call. which looks a little like this: def("copy", copy, imageMorph_copy() [return_value_policy<manage_new_object>()] ); with a overloading operator which looks a little like this: BOOST_PYTHON_FUNCTION_OVERLOADS(imageMorph_copy, copy, 1, 7) the overloader is correct in terms of syntax because i have other functions i am using in same syntax and it works..just fails on this one. here is the error i get: ../python/imageMorph_boost.cpp: In function `void init_module_imageMorph()': ../python/imageMorph_boost.cpp:107: error: no matching function for call to `def(const char[5], <unknown type>, boost::python::detail::overloads_proxy<boost::python::return_value_policy<boost::python::manage_new_object, boost::python::default_call_policies>, imageMorph_copy>)' Any suggestions? i have tried to update my GCC to the latest and greatest. Thanks
I have made a .cpp file with boost_python_module inside it and a function call. which looks a little like this:
def("copy", copy, imageMorph_copy() ^^^^ My guess is that this is ambiguous and needs to be cast to a
"Dirgesh Patel" <dirgesh.patel@hp.com> writes: particular function pointer type, or better yet assigned to a function pointer of the correct type before passing it. See http://mail.python.org/pipermail/c++-sig/2004-December/008389.html
[return_value_policy<manage_new_object>()] );
with a overloading operator which looks a little like this:
BOOST_PYTHON_FUNCTION_OVERLOADS(imageMorph_copy, copy, 1, 7)
the overloader is correct in terms of syntax because i have other functions i am using in same syntax and it works..just fails on this one.
here is the error i get:
../python/imageMorph_boost.cpp: In function `void init_module_imageMorph()': ../python/imageMorph_boost.cpp:107: error: no matching function for call to `def(const char[5], <unknown type>, boost::python::detail::overloads_proxy<boost::python::return_value_policy<boost::python::manage_new_object, boost::python::default_call_policies>, imageMorph_copy>)'
Any suggestions? i have tried to update my GCC to the latest and greatest.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
so i had this before def("copy", imageMorph_copy, imageMorph_copy() [return_value_policy<manage_new_object>()] ); and i changed it to: def("copy", static_cast<bkimage (*)(bkimage,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)>(imageMorph_copy), imageMorph_copy() [return_value_policy<manage_new_object>()] ); and now i get this error: ../python/imageMorph_boost.cpp: In function `void init_module_imageMorph()': ../python/imageMorph_boost.cpp:108: error: expected primary-expression before ')' token any suggestions...seems like just a syntax error. thanks "Dirgesh Patel" <dirgesh.patel@hp.com> wrote in message news:ddvos9$oae$1@sea.gmane.org...
I have made a .cpp file with boost_python_module inside it and a function call. which looks a little like this:
def("copy", copy, imageMorph_copy() [return_value_policy<manage_new_object>()] );
with a overloading operator which looks a little like this:
BOOST_PYTHON_FUNCTION_OVERLOADS(imageMorph_copy, copy, 1, 7)
the overloader is correct in terms of syntax because i have other functions i am using in same syntax and it works..just fails on this one.
here is the error i get:
../python/imageMorph_boost.cpp: In function `void init_module_imageMorph()': ../python/imageMorph_boost.cpp:107: error: no matching function for call to `def(const char[5], <unknown type>, boost::python::detail::overloads_proxy<boost::python::return_value_policy<boost::python::manage_new_object, boost::python::default_call_policies>, imageMorph_copy>)'
Any suggestions? i have tried to update my GCC to the latest and greatest.
Thanks
Dirgesh Patel wrote:
so i had this before def("copy", imageMorph_copy, imageMorph_copy() [return_value_policy<manage_new_object>()] );
and i changed it to: def("copy", static_cast<bkimage (*)(bkimage,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)>(imageMorph_copy), imageMorph_copy() [return_value_policy<manage_new_object>()] );
shouldn't that be def("copy", static_cast<bkimage (*)(bkimage,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)> (imageMorph_copy), &imageMorph_copy, return_value_policy<manage_new_object>() );
i get the same error..i was told you have to cast the function name to a ptr and can't use (&) let me know what you think thanks d "Mike Rovner" <mrovner@propel.com> wrote in message news:deil0f$93n$1@sea.gmane.org...
Dirgesh Patel wrote:
so i had this before def("copy", imageMorph_copy, imageMorph_copy() [return_value_policy<manage_new_object>()] );
and i changed it to: def("copy", static_cast<bkimage (*)(bkimage,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)>(imageMorph_copy), imageMorph_copy() [return_value_policy<manage_new_object>()] );
shouldn't that be
def("copy", static_cast<bkimage (*)(bkimage,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)> (imageMorph_copy), &imageMorph_copy, return_value_policy<manage_new_object>() );
Dirgesh Patel wrote:
i get the same error..i was told you have to cast the function name to a ptr and can't use (&)
right, delete one extra pointer then: def("copy", static_cast<bkimage (*)(bkimage,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)> (imageMorph_copy), return_value_policy<manage_new_object>() );
i am trying to wrap this function bkimage* copy(bkimage *img, xint32_t pln0, xint32_t row0, xint32_t col0, xint32_t pln1, xint32_t row1, xint32_t col1) and this is the line in the boost.cpp file def("copy", static_cast<bkimage* (*)(bkimage*,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)>(imageMorph_copy()) [return_value_policy<manage_new_object>() ]); and i get this error: ../python/imageMorph_boost.cpp: In function `void init_module_imageMorph()': ../python/imageMorph_boost.cpp:107: error: invalid static_cast from type `imageMorph_copy' to type `bkimage*(*)(bkimage*, xint32_t, xint32_t, xint32_t, xint32_t, xint32_t, xint32_t)' we are trying to return a ptr to bkimage. please advice. thanks dirgesh "Mike Rovner" <mrovner@propel.com> wrote in message news:deisg2$u5c$1@sea.gmane.org...
Dirgesh Patel wrote:
i get the same error..i was told you have to cast the function name to a ptr and can't use (&)
right, delete one extra pointer then:
def("copy", static_cast<bkimage (*)(bkimage,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)> (imageMorph_copy), return_value_policy<manage_new_object>() );
Dirgesh Patel wrote:
i am trying to wrap this function
bkimage* copy(bkimage *img, xint32_t pln0, xint32_t row0, xint32_t col0, xint32_t pln1, xint32_t row1, xint32_t col1)
If you have only one signature you don't need a cast. def("copy", &imageMorph_copy, return_value_policy<manage_new_object>());
and this is the line in the boost.cpp file def("copy", static_cast<bkimage* (*)(bkimage*,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)>(imageMorph_copy()) [return_value_policy<manage_new_object>() ]);
try def("copy", static_cast<bkimage* (*)(bkimage*,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t,xint32_t)>(imageMorph_copy) [return_value_policy<manage_new_object>() ]);
I built boost python with bjam (with all kind of options static dynamic single etc) and I am trying to use the libboost_python*.lib in my vc-7_1 project to produce getting_started1.dll which I can load into Python so that I would not need boost_python.dll. But no combination of libraries works. I am getting linking errors bellow ... Is there a way around this? Linking... LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in getting_started1.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libcpmtd.lib(string.obj) msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in getting_started1.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in getting_started1.obj msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in getting_started1.obj MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z) already defined in LIBCMT.lib(stdexcpt.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: int __thiscall type_info::operator==(class type_info const &)const " (??8type_info@@QBEHABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: char const * __thiscall type_info::name(void)const " (?name@type_info@@QBEPBDXZ) already defined in LIBCMT.lib(typname.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in LIBCMT.lib(stdexcpt.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: _memmove already defined in LIBCMT.lib(memmove.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: int __thiscall type_info::before(class type_info const &)const " (?before@type_info@@QBEHABV1@@Z) already defined in LIBCMT.lib(typinfo.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: virtual __thiscall bad_cast::~bad_cast(void)" (??1bad_cast@@UAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall bad_cast::bad_cast(class bad_cast const &)" (??0bad_cast@@QAE@ABV0@@Z) already defined in LIBCMT.lib(stdexcpt.obj) MSVCRT.lib(MSVCR71.dll) : error LNK2005: "public: __thiscall exception::exception(char const * const &)" (??0exception@@QAE@ABQBD@Z) already defined in LIBCMT.lib(stdexcpt.obj) MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in getting_started1.obj; second definition ignored msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in libcpmtd.lib(string.obj); second definition ignored msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in getting_started1.obj; second definition ignored msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in getting_started1.obj; second definition ignored msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in getting_started1.obj; second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: __thiscall bad_cast::bad_cast(char const *)" (??0bad_cast@@QAE@PBD@Z) already defined in LIBCMT.lib(stdexcpt.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: int __thiscall type_info::operator==(class type_info const &)const " (??8type_info@@QBEHABV0@@Z) already defined in LIBCMT.lib(typinfo.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: char const * __thiscall type_info::name(void)const " (?name@type_info@@QBEPBDXZ) already defined in LIBCMT.lib(typname.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) already defined in LIBCMT.lib(stdexcpt.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: _memmove already defined in LIBCMT.lib(memmove.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: int __thiscall type_info::before(class type_info const &)const " (?before@type_info@@QBEHABV1@@Z) already defined in LIBCMT.lib(typinfo.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: virtual __thiscall bad_cast::~bad_cast(void)" (??1bad_cast@@UAE@XZ) already defined in LIBCMT.lib(stdexcpt.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: __thiscall bad_cast::bad_cast(class bad_cast const &)" (??0bad_cast@@QAE@ABV0@@Z) already defined in LIBCMT.lib(stdexcpt.obj); second definition ignored MSVCRT.lib(MSVCR71.dll) : warning LNK4006: "public: __thiscall exception::exception(char const * const &)" (??0exception@@QAE@ABQBD@Z) already defined in LIBCMT.lib(stdexcpt.obj); second definition ignored MSVCRT.lib(ti_inst.obj) : warning LNK4006: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj); second definition ignored MSVCRT.lib(ti_inst.obj) : warning LNK4006: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj); second definition ignored Creating library Debug/getting_started1.lib and object Debug/getting_started1.exp LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library getting_started1.obj : warning LNK4217: locally defined symbol ??0py_function_impl_base@objects@python@boost@@QAE@XZ (public: __thiscall boost::python::objects::py_function_impl_base::py_function_impl_base(void)) imported in function "public: __thiscall boost::python::objects::caller_py_function_impl<struct boost::python::detail::caller<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void),struct boost::python::default_call_policies,struct boost::mpl::vector1<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >
::caller_py_function_impl<struct boost::python::detail::caller<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void),struct boost::python::default_call_policies,struct boost::mpl::vector1<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >(struct boost::python::detail::caller<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void),struct boost::python::default_call_policies,struct boost::mpl::vector1<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &)" (??0?$caller_py_function_impl@U?$caller@P6G?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZUdefault_call_policies@python@boost@@U?$vector1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@mpl@5@@detail@python@boost@@@objects@python@boost@@QAE@ABU?$caller@P6G?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZUdefault_call_policies@python@boost@@U?$vector1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@mpl@5@@detail@23@@Z) getting_started1.obj : warning LNK4217: locally defined symbol ??1py_function_impl_base@objects@python@boost@@UAE@XZ (public: virtual __thiscall boost::python::objects::py_function_impl_base::~py_function_impl_base(void)) imported in function "public: virtual __thiscall boost::python::objects::caller_py_function_impl<struct boost::python::detail::caller<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void),struct boost::python::default_call_policies,struct boost::mpl::vector1<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > ::~caller_py_function_impl<struct boost::python::detail::caller<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void),struct boost::python::default_call_policies,struct boost::mpl::vector1<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >(void)" (??1?$caller_py_function_impl@U?$caller@P6G?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZUdefault_call_policies@python@boost@@U?$vector1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@mpl@5@@detail@python@boost@@@objects@python@boost@@UAE@XZ) getting_started1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __stdcall boost::python::detail::init_module(char const *,void (__stdcall*)(void))" (__imp_?init_module@detail@python@boost@@YGXPBDP6GXXZ@Z) referenced in function _initgetting_started1@0 getting_started1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __stdcall boost::python::detail::scope_setattr_doc(char const *,class boost::python::api::object const &,char const *)" (__imp_?scope_setattr_doc@detail@python@boost@@YGXPBDABVobject@api@23@0@Z) referenced in function "void __stdcall boost::python::def<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void)>(char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void))" (??$def@P6G?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ@python@boost@@YGXPBDP6G?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ@Z) getting_started1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::python::api::object __stdcall boost::python::objects::function_object(struct boost::python::objects::py_function const &)" (__imp_?function_object@objects@python@boost@@YG?AVobject@api@23@ABUpy_function@123@@Z) referenced in function "class boost::python::api::object __stdcall boost::python::detail::make_function_aux<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void),struct boost::python::default_call_policies,struct boost::mpl::vector1<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__stdcall*)(void),struct boost::python::default_call_policies const &,struct boost::mpl::vector1<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > const &)" (??$make_function_aux@P6G?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZUdefault_call_policies@python@boost@@U?$vector1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@mpl@5@@detail@python@boost@@YG?AVobject@api@12@P6G?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZABUdefault_call_policies@12@ABU?$vector1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@mpl@2@@Z) getting_started1.obj : error LNK2019: unresolved external symbol __imp__PyString_FromStringAndSize@8 referenced in function "public: struct _object * __thiscall boost::python::to_python_value<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &>::operator()(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (??R?$to_python_value@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@python@boost@@QBEPAU_object@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) getting_started1.obj : error LNK2019: unresolved external symbol __imp__PyInt_FromLong@4 referenced in function "public: struct _object * __thiscall boost::python::to_python_value<int const &>::operator()(int const &)const " (??R?$to_python_value@ABH@python@boost@@QBEPAU_object@@ABH@Z) getting_started1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct boost::python::converter::rvalue_from_python_stage1_data __stdcall boost::python::converter::rvalue_from_python_stage1(struct _object *,struct boost::python::converter::registration const &)" (__imp_?rvalue_from_python_stage1@converter@python@boost@@YG?AUrvalue_from_python_stage1_data@123@PAU_object@@ABUregistration@123@@Z) referenced in function "public: __thiscall boost::python::converter::arg_rvalue_from_python<int>::arg_rvalue_from_python<int>(struct _object *)" (??0?$arg_rvalue_from_python@H@converter@python@boost@@QAE@PAU_object@@@Z) getting_started1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct boost::python::converter::registration const & __stdcall boost::python::converter::registry::lookup(struct boost::python::type_info)" (__imp_?lookup@registry@converter@python@boost@@YGABUregistration@234@Utype_info@34@@Z) referenced in function "struct boost::python::converter::registration const & __stdcall boost::python::converter::detail::registry_lookup<int const volatile >(int const volatile & (__stdcall*)(void))" (??$registry_lookup@$$CDH@detail@converter@python@boost@@YGABUregistration@123@P6GADHXZ@Z) Debug/getting_started1.dll : fatal error LNK1120: 7 unresolved externals
"Vin Jovanovic" <fractal97@hotmail.com> writes:
I built boost python with bjam (with all kind of options static dynamic single etc) and I am trying to use the libboost_python*.lib in my vc-7_1 project to produce getting_started1.dll which I can load into Python so that I would not need boost_python.dll. But no combination of libraries works. I am getting linking errors bellow ... Is there a way around this?
Linking... LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)"
These symbols are in your C++ runtime library, i.e. part of the compiler. Perhaps your project's build options are incompatible with those used to build libboost_python.lib? Try using bjam -o log.txt to "build" libboost_python.lib and look at log.txt to see which compile options were used. Then make your project use the same ones. -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (4)
-
David Abrahams -
Dirgesh Patel -
Mike Rovner -
Vin Jovanovic