From finjulhich at gmail.com Sun Jul 8 22:44:49 2018 From: finjulhich at gmail.com (MM) Date: Mon, 9 Jul 2018 03:44:49 +0100 Subject: [C++-sig] map_indexing_suite for boost::container::flat_map, std::map, std::unordered_amp Message-ID: Hello, I've tried to adapt using myfm = boost::container::flat_map; with boost::python::map_indexing_suite class_< myfm, myfm* >("myfm") .def( map_indexing_suite{} ) ; I get a compile errors: /usr/include/boost/python/detail/invoke.hpp:75:14: error: no match for call > to ?(const > boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning T*>) (const T*)? > ... > Caller = boost::python::detail::caller V>&), default_call_policies ...> I would suspect that there is some function that returns the key_type of the flat_map and takes a single argument of the value_type, but I can't find any. If there's one, I would need pick a return value policy for it. As a matter of fact, I've switched to std::unordered_map and std::map, and I am encountering the same problem MM -------------- next part -------------- An HTML attachment was scrubbed... URL: From dannyc22192 at gmail.com Tue Jul 10 15:55:21 2018 From: dannyc22192 at gmail.com (Danny C) Date: Wed, 11 Jul 2018 01:25:21 +0530 Subject: [C++-sig] How to derive a python class from a C++ base abstract class [Boost.python] Message-ID: Hi, I am trying to build a hybrid system for exposing my C++ library to python and some other languages. Use case: Expose certain C++ abstract classes to be extended in python. A different exposed concrete class instance uses the methods from extended classes as callbacks Q1: I want to derive a python class whose base class is an ABSTRACT class written in C++. How do I do this. I've read many threads and similar questions but most of them are concerning SWIG. I want to use boost.python for my purpose. Any help on this is really appreciated. Q2: How do I implement callbacks from C++ to python i.e. my callback function is written in python. Thanks iowax -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at seefeld.name Tue Jul 10 16:02:12 2018 From: stefan at seefeld.name (Stefan Seefeld) Date: Tue, 10 Jul 2018 16:02:12 -0400 Subject: [C++-sig] How to derive a python class from a C++ base abstract class [Boost.python] In-Reply-To: References: Message-ID: <8a1d948e-0b5e-7931-8a94-65c0f87818ff@seefeld.name> On 2018-07-10 03:55 PM, Danny C wrote: > Hi, > > I am trying to build a hybrid system for exposing my C++ library to > python and some other languages. > > Use case: > Expose certain C++ abstract classes to be extended in python. A > different exposed concrete class instance uses the methods?from > extended classes as callbacks > > > Q1: I want to derive a python class whose base class is an ABSTRACT > class written in C++. How do I do this. I've read many threads and > similar questions but most of them are concerning SWIG. I want to use > boost.python for my purpose. Any help on this is really appreciated. > > Q2: How do I implement callbacks from C++? to python i.e. my callback > function is written in python. Have you read the docs (http://boostorg.github.io/python/doc/html/tutorial/tutorial/exposing.html#tutorial.exposing.class_virtual_functions) ? Stefan -- ...ich hab' noch einen Koffer in Berlin... -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.png Type: image/png Size: 1478 bytes Desc: not available URL: From servando.miguel.sm at gmail.com Fri Jul 13 08:41:50 2018 From: servando.miguel.sm at gmail.com (Servando Arboli) Date: Fri, 13 Jul 2018 13:41:50 +0100 Subject: [C++-sig] Boost python undef symbols Message-ID: Dear all, I?m trying to install boost python in Windows but I must be doing something wrong. The execution of b2 with python has produced a library, but when I?m trying to link I get errors related to undefined symbols. I?ve done a dumpbin /symbols with the library generated by b2, filtering the undef symbols, I get plenty of them: *$ grep UNDEF boost_python_symbols.txt* 37C 00000000 UNDEF notype () External | ??2 at YAPEAX_K@Z (void * __cdecl operator new(unsigned __int64)) 37D 00000000 UNDEF notype () External | ??3 at YAXPEAX@Z (void __cdecl operator delete(void *)) 37E 00000000 UNDEF notype () External | atexit 37F 00000000 UNDEF notype () External | __std_terminate 380 00000000 UNDEF notype External | __imp__invalid_parameter_noinfo_noreturn 381 00000000 UNDEF notype External | __imp_memmove 382 00000000 UNDEF notype External | __imp_PyObject_IsTrue 383 00000000 UNDEF notype External | __imp_PyUnicode_FromStringAndSize 384 00000000 UNDEF notype External | __imp_PyLong_FromLong 385 00000000 UNDEF notype External | __imp_PyLong_FromUnsignedLong 386 00000000 UNDEF notype External | __imp_PyLong_FromUnsignedLongLong 387 00000000 UNDEF notype External | __imp_PyTuple_New 388 00000000 UNDEF notype External | __imp_PyErr_Occurred 389 00000000 UNDEF notype External | __imp_PyObject_Size ? ? ? 124 00000000 UNDEF notype () External | ?getattr at api@python at boost @@YA?AVobject at 123@AEBV4123 at PEBD@Z (class boost::python::api::object __cdecl boost::python::api::getattr(class boost::python::api::object const &,char const *)) 18C 00000000 UNDEF notype () External | __CxxFrameHandler3 18D 00000000 UNDEF notype () External | __GSHandlerCheck_EH 18E 00000000 UNDEF notype () External | __security_check_cookie 465 00000000 UNDEF notype External | __imp__Py_NoneStruct 466 00000000 UNDEF notype External | __imp_PyDict_Type 467 00000000 UNDEF notype External | ??_7type_info@@6B@ (const type_info::`vftable') 4A5 00000000 UNDEF notype External | __security_cookie 032 00000000 UNDEF notype () External | atexit 033 00000000 UNDEF notype () External | __std_terminate 034 00000000 UNDEF notype External | __imp_PyObject_CallFunction 035 00000000 UNDEF notype () External | ?throw_error_already_set at python@boost@@YAXXZ (void __cdecl boost::python::throw_error_already_set(void)) 04C 00000000 UNDEF notype () External | __CxxFrameHandler3 0AC 00000000 UNDEF notype External | __imp__Py_NoneStruct 0AD 00000000 UNDEF notype External | __imp_PyLong_Type 0BE 00000000 UNDEF notype () External | atexit 0BF 00000000 UNDEF notype () External | __std_terminate 0C0 00000000 UNDEF notype External | __imp_PyLong_AsSsize_t 0C1 00000000 UNDEF notype External | __imp_PyLong_FromLongLong 0C2 00000000 UNDEF notype External | __imp_PyList_New 0C3 00000000 UNDEF notype External | __imp_PyList_Insert 0C4 00000000 UNDEF notype External | __imp_PyList_Append 0C5 00000000 UNDEF notype External | __imp_PyList_Sort 0C6 00000000 UNDEF notype External | __imp_PyList_Reverse 0C7 00000000 UNDEF notype External | __imp_PyErr_Occurred 0C8 00000000 UNDEF notype External | __imp_PyEval_CallFunction 0C9 00000000 UNDEF notype External | __imp_PyObject_Call 0CA 00000000 UNDEF notype External | __imp_PyObject_CallFunction 0CC 00000000 UNDEF notype () External | ?lookup at registry @converter at python@boost@@YAAEBUregistration at 234@Utype_info at 34@@Z (struct boost::python::converter::registration const & __cdecl boost::python::converter::registry::lookup(struct boost::python::type_info)) 0CD 00000000 UNDEF notype () External | ?throw_error_already_set at python@boost@@YAXXZ (void __cdecl boost::python::throw_error_already_set(void)) 0E7 00000000 UNDEF notype () External | ?getattr at api@python at boost @@YA?AVobject at 123@AEBV4123 at PEBD@Z (class boost::python::api::object __cdecl boost::python::api::getattr(class boost::python::api::object const &,char const *)) 12E 00000000 UNDEF notype () External | __CxxFrameHandler3 38C 00000000 UNDEF notype External | __imp__Py_NoneStruct 38D 00000000 UNDEF notype External | __imp_PyList_Type 38E 00000000 UNDEF notype External | ??_7type_info@@6B@ (const type_info::`vftable') When I?ve tried to compile the quickstart example with the following command, I get the unresolved symbols errors *C:\lib\boost_1_67_0\libs\python\example\quickstart>CL /LD /MD /I"C:\lib\boost_1_67_0" /I"C:\ProgramData\Anaconda3\include" extending.cpp /link /DLL /libpath:"C:\lib\boost_1_67_0\stage\lib" /libpath:"C:\ProgramData\Anaconda3\libs"* extending.cpp C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xlocale(341): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\exception(359): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc Microsoft (R) Incremental Linker Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:extending.dll /dll /implib:extending.lib /DLL /libpath:C:\lib\boost_1_67_0\stage\lib /libpath:C:\ProgramData\Anaconda3\libs extending.obj Creating library extending.lib and object extending.exp extending.obj : warning LNK4217: locally defined symbol ??0instance_holder at python@boost@@QEAA at XZ (public: __cdecl boost::python::instance_holder::instance_holder(void)) imported in function "public: __cdecl boost::python::objects::value_holder::value_holder,class std::allocator > > >(struct _object *,struct boost::python::objects::reference_to_value,class std::allocator > >)" (??$?0U?$reference_to_value at V?$basic_string at DU ?$char_traits at D@std@@V?$allocator at D@2@@std@@@objects at python@boost@ @@?$value_holder at Vhello@?A0xc2d1617d@@@objects at python@boost@ @QEAA at PEAU_object@@U?$reference_to_value at V?$basic_string at DU?$char_traits at D @std@@V?$allocator at D@2@@std@@@123@@Z) extending.obj : warning LNK4217: locally defined symbol ??1instance_holder at python@boost@@UEAA at XZ (public: virtual __cdecl boost::python::instance_holder::~instance_holder(void)) imported in function "public: virtual __cdecl boost::python::objects::value_holder::~value_holder(void)" (??1?$value_holder at Vhello@?A0xc2d1617d@ @@objects at python@boost@@UEAA at XZ) extending.obj : warning LNK4217: locally defined symbol ?install at instance_holder@python at boost@@QEAAXPEAU_object@@@Z (public: void __cdecl boost::python::instance_holder::install(struct _object *)) imported in function "public: static struct _object * __cdecl boost::python::objects::make_instance_impl,struct boost::python::objects::make_instance > >::execute const >(class boost::reference_wrapper const &)" (??$execute@$$CBV?$reference_wrapper@$$CBVhello@?A0xc2d1617d@ @@boost@@@?$make_instance_impl at Vhello@?A0xc2d1617d@@U?$value_holder at Vhello @?A0xc2d1617d@@@objects at python@boost@@U?$make_instance at Vhello@?A0xc2d1617d@ @U?$value_holder at Vhello@?A0xc2d1617d@@@objects at python@boost@@@456@ @objects at python@boost@@SAPEAU_object@@AEBV?$reference_wrapper@$$CBVhello@ ?A0xc2d1617d@@@3@@Z) extending.obj : warning LNK4217: locally defined symbol ?allocate at instance_holder@python at boost@@SAPEAXPEAU_object@@_K1 at Z (public: static void * __cdecl boost::python::instance_holder::allocate(struct _object *,unsigned __int64,unsigned __int64)) imported in function "public: static void __cdecl boost::python::objects::make_holder<1>::apply,struct boost::mpl::vector1,class std::allocator > > >::execute(struct _object *,class std::basic_string,class std::allocator >)" (?execute@?$apply at U?$value_holder at Vhello @?A0xc2d1617d@@@objects at python@boost@@U?$vector1 at V?$basic_string at DU ?$char_traits at D@std@@V?$allocator at D@2@@std@@@mpl at 4@@?$make_holder@ $00 at objects@python at boost@@SAXPEAU_object@@V?$basic_string at DU?$char_traits at D @std@@V?$allocator at D@2@@std@@@Z) extending.obj : warning LNK4217: locally defined symbol ?deallocate at instance_holder@python at boost@@SAXPEAU_object@@PEAX at Z (public: static void __cdecl boost::python::instance_holder::deallocate(struct _object *,void *)) imported in function __catch$?execute@?$apply at U ?$value_holder at Vhello@?A0xc2d1617d@@@objects at python@boost@@U?$vector1 at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@mpl at 4 @@?$make_holder@$00 at objects@python at boost@@SAXPEAU_object@@V?$basic_string at DU ?$char_traits at D@std@@V?$allocator at D@2@@std@@@Z$0 extending.obj : warning LNK4217: locally defined symbol ?lookup at registry @converter at python@boost@@YAAEBUregistration at 234@Utype_info at 34@@Z (struct boost::python::converter::registration const & __cdecl boost::python::converter::registry::lookup(struct boost::python::type_info)) imported in function "struct boost::python::converter::registration const & __cdecl boost::python::converter::detail::registry_lookup2(class `anonymous namespace'::hello const & (__cdecl*)(void))" (??$registry_lookup2@$$CBVhello@?A0xc2d1617d@ @@detail at converter@python at boost@@YAAEBUregistration at 123@P6AAEBVhello@ ?A0xc2d1617d@@XZ at Z) extending.obj : warning LNK4217: locally defined symbol ?query at registry @converter at python@boost@@YAPEBUregistration at 234@Utype_info at 34@@Z (struct boost::python::converter::registration const * __cdecl boost::python::converter::registry::query(struct boost::python::type_info)) imported in function "public: static struct _typeobject const * __cdecl boost::python::converter::expected_pytype_for_arg::get_pytype(void)" (?get_pytype@ ?$expected_pytype_for_arg at AEAVhello@?A0xc2d1617d@@@converter at python@boost@ @SAPEBU_typeobject@@XZ) extending.obj : warning LNK4217: locally defined symbol ?insert at registry @converter at python@boost@@YAXP6APEAU_object@@PEBX at ZUtype_info @34 at P6APEBU_typeobject@@XZ at Z (void __cdecl boost::python::converter::registry::insert(struct _object * (__cdecl*)(void const *),struct boost::python::type_info,struct _typeobject const * (__cdecl*)(void))) imported in function "public: __cdecl boost::python::to_python_converter > >,1>::to_python_converter > >,1>(void)" (??0?$to_python_converter at Vhello @?A0xc2d1617d@@U?$class_cref_wrapper at Vhello@?A0xc2d1617d@ @U?$make_instance at Vhello@?A0xc2d1617d@@U?$value_holder at Vhello@?A0xc2d1617d@ @@objects at python@boost@@@objects at python@boost@@@objects at python@boost@ @$00 at python@boost@@QEAA at XZ) extending.obj : warning LNK4217: locally defined symbol ?insert at registry @converter at python@boost@@YAXP6APEAXPEAU_object@ @@ZP6AX0PEAUrvalue_from_python_stage1_data at 234@@ZUtype_info at 34 @P6APEBU_typeobject@@XZ at Z (void __cdecl boost::python::converter::registry::insert(void * (__cdecl*)(struct _object *),void (__cdecl*)(struct _object *,struct boost::python::converter::rvalue_from_python_stage1_data *),struct boost::python::type_info,struct _typeobject const * (__cdecl*)(void))) imported in function "public: __cdecl boost::python::converter::shared_ptr_from_python::shared_ptr_from_python(void)" (??0?$shared_ptr_from_python at Vhello@?A0xc2d1617d@@Vshared_ptr at boost @@@converter at python@boost@@QEAA at XZ) extending.obj : warning LNK4217: locally defined symbol ?get_class_object at registration@converter at python@boost@@QEBAPEAU_typeobject@@XZ (public: struct _typeobject * __cdecl boost::python::converter::registration::get_class_object(void)const ) imported in function "public: static struct _typeobject * __cdecl boost::python::objects::make_instance >::get_class_object const >(class boost::reference_wrapper const &)" (??$get_class_object@$$CBV?$reference_wrapper@$$CBVhello@ ?A0xc2d1617d@@@boost@@@?$make_instance at Vhello@?A0xc2d1617d@ @U?$value_holder at Vhello@?A0xc2d1617d@@@objects at python@boost@@@objects at python @boost@@SAPEAU_typeobject@@AEBV?$reference_wrapper@$$CBVhello@?A0xc2d1617d@ @@3@@Z) extending.obj : warning LNK4217: locally defined symbol ?expected_from_python_type at registration@converter at python@boost@ @QEBAPEBU_typeobject@@XZ (public: struct _typeobject const * __cdecl boost::python::converter::registration::expected_from_python_type(void)const ) imported in function "public: static struct _typeobject const * __cdecl boost::python::converter::expected_from_python_type_direct::get_pytype(void)" (?get_pytype@ ?$expected_from_python_type_direct at Vhello@?A0xc2d1617d@@@converter at python @boost@@SAPEBU_typeobject@@XZ) extending.obj : warning LNK4217: locally defined symbol ?throw_error_already_set at python@boost@@YAXXZ (void __cdecl boost::python::throw_error_already_set(void)) imported in function "struct _object * __cdecl boost::python::expect_non_null(struct _object *)" (??$expect_non_null at U_object@@@python at boost@@YAPEAU_object@ @PEAU2@@Z) extending.obj : warning LNK4217: locally defined symbol ??0shared_ptr_deleter at converter@python at boost@@QEAA at V?$handle at U_object@@@23@@Z (public: __cdecl boost::python::converter::shared_ptr_deleter::shared_ptr_deleter(class boost::python::handle)) imported in function "private: static void __cdecl boost::python::converter::shared_ptr_from_python::construct(struct _object *,struct boost::python::converter::rvalue_from_python_stage1_data *)" (?construct@?$shared_ptr_from_python at Vhello@?A0xc2d1617d@ @Vshared_ptr at boost@@@converter at python@boost@@CAXPEAU_object@ @PEAUrvalue_from_python_stage1_data at 234@@Z) extending.obj : warning LNK4217: locally defined symbol ??1shared_ptr_deleter at converter@python at boost@@QEAA at XZ (public: __cdecl boost::python::converter::shared_ptr_deleter::~shared_ptr_deleter(void)) imported in function "public: __cdecl boost::detail::shared_count::shared_count(void *,struct boost::python::converter::shared_ptr_deleter)" (??$?0PEAXUshared_ptr_deleter at converter@python at boost@@@shared_count at detail @boost@@QEAA at PEAXUshared_ptr_deleter@converter at python@2@@Z) extending.obj : warning LNK4217: locally defined symbol ??Rshared_ptr_deleter at converter@python at boost@@QEAAXPEBX at Z (public: void __cdecl boost::python::converter::shared_ptr_deleter::operator()(void const *)) imported in function "public: __cdecl boost::detail::shared_count::shared_count(void *,struct boost::python::converter::shared_ptr_deleter)" (??$?0PEAXUshared_ptr_deleter at converter@python at boost@@@shared_count at detail @boost@@QEAA at PEAXUshared_ptr_deleter@converter at python@2@@Z) extending.obj : warning LNK4217: locally defined symbol ?get_lvalue_from_python at converter@python at boost@@YAPEAXPEAU_object@ @AEBUregistration at 123@@Z (void * __cdecl boost::python::converter::get_lvalue_from_python(struct _object *,struct boost::python::converter::registration const &)) imported in function "public: __cdecl boost::python::converter::reference_arg_from_python::reference_arg_from_python(struct _object *)" (??0?$reference_arg_from_python at AEAVhello@?A0xc2d1617d@@@converter at python @boost@@QEAA at PEAU_object@@@Z) extending.obj : warning LNK4217: locally defined symbol ?rvalue_from_python_stage1 at converter@python at boost @@YA?AUrvalue_from_python_stage1_data at 123@PEAU_object@@AEBUregistration at 123@@Z (struct boost::python::converter::rvalue_from_python_stage1_data __cdecl boost::python::converter::rvalue_from_python_stage1(struct _object *,struct boost::python::converter::registration const &)) imported in function "public: __cdecl boost::python::converter::arg_rvalue_from_python::arg_rvalue_from_python(struct _object *)" (??0?$arg_rvalue_from_python at AEBVhello@?A0xc2d1617d@@@converter at python @boost@@QEAA at PEAU_object@@@Z) extending.obj : warning LNK4217: locally defined symbol ??1py_function_impl_base at objects@python at boost@@UEAA at XZ (public: virtual __cdecl boost::python::objects::py_function_impl_base::~py_function_impl_base(void)) imported in function "public: virtual __cdecl boost::python::objects::caller_py_function_impl,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &> > >::~caller_py_function_impl,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &> > >(void)" (??1?$caller_py_function_impl at U ?$caller at P6A?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@ @AEBVhello@?A0xc2d1617d@@@ZUdefault_call_policies at python@boost@@U?$vector2 at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@mpl at 7@@detail at python@boost@@@objects at python@boost@@UEAA at XZ) extending.obj : warning LNK4217: locally defined symbol ??0py_function_impl_base at objects@python at boost@@QEAA at XZ (public: __cdecl boost::python::objects::py_function_impl_base::py_function_impl_base(void)) imported in function "public: __cdecl boost::python::objects::caller_py_function_impl,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &> > >::caller_py_function_impl,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &> > >(struct boost::python::detail::caller,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &> > const &)" (??0?$caller_py_function_impl at U ?$caller at P6A?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@ @AEBVhello@?A0xc2d1617d@@@ZUdefault_call_policies at python@boost@@U?$vector2 at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@mpl at 7@@detail at python@boost@@@objects at python@boost@@QEAA at AEBU ?$caller at P6A?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@ @AEBVhello@?A0xc2d1617d@@@ZUdefault_call_policies at python@boost@@U?$vector2 at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@mpl at 7@@detail at 23@@Z) extending.obj : warning LNK4217: locally defined symbol ?add_to_namespace at objects@python at boost@@YAXAEBVobject at api@23 at PEBD01@Z (void __cdecl boost::python::objects::add_to_namespace(class boost::python::api::object const &,char const *,class boost::python::api::object const &,char const *)) imported in function "private: void __cdecl boost::python::class_::def_impl,class std::allocator > (__cdecl*)(class A0xc2d1617d::hello const &),struct boost::python::detail::def_helper >(class `anonymous namespace'::hello *,char const *,class std::basic_string,class std::allocator > (__cdecl*)(class A0xc2d1617d::hello const &),struct boost::python::detail::def_helper const &,...)" (??$def_impl at Vhello @?A0xc2d1617d@@P6A?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@ @std@@AEBV12@@ZU?$def_helper at PEBDUnot_specified@detail at python@boost@ @U1234 at U1234@@detail at python@boost@@@?$class_ at Vhello@?A0xc2d1617d@ @Unot_specified at detail@python at boost@@U3456 at U3456@@python at boost @@AEAAXPEAVhello@?A0xc2d1617d@@PEBDP6A?AV?$basic_string at DU?$char_traits at D @std@@V?$allocator at D@2@@std@@AEBV34@@ZAEBU?$def_helper at PEBDUnot_specified @detail at python@boost@@U1234 at U1234@@detail at 12@ZZ) extending.obj : warning LNK4217: locally defined symbol ??0class_base at objects@python at boost@@QEAA at PEBD_KQEBUtype_info@23 at 0@Z (public: __cdecl boost::python::objects::class_base::class_base(char const *,unsigned __int64,struct boost::python::type_info const * const,char const *)) imported in function "public: __cdecl boost::python::class_::class_,class std::allocator >,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_> >(char const *,struct boost::python::init_base,class std::allocator >,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_> > const &)" (??$?0V?$init at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@Uvoid_ at mpl @boost@@U345 at U345@U345 at U345@U345 at U345@U345 at U345@U345 at U345@U345 at U345@U345@ @python at boost@@@?$class_ at Vhello@?A0xc2d1617d@@Unot_specified at detail @python at boost@@U3456 at U3456@@python at boost@@QEAA at PEBDAEBU?$init_base at V?$init at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@Uvoid_ at mpl @boost@@U345 at U345@U345 at U345@U345 at U345@U345 at U345@U345 at U345@U345 at U345@U345@ @python at boost@@@12@@Z) extending.obj : warning LNK4217: locally defined symbol ?set_instance_size at class_base@objects at python@boost@@IEAAX_K at Z (protected: void __cdecl boost::python::objects::class_base::set_instance_size(unsigned __int64)) imported in function "private: void __cdecl boost::python::class_::initialize,class std::allocator >,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_> > >(struct boost::python::init_base,class std::allocator >,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_,struct boost::mpl::void_> > const &)" (??$initialize at U ?$init_base at V?$init at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@ @std@@Uvoid_ at mpl@boost@@U345 at U345@U345 at U345@U345 at U345@U345 at U345@U345 at U345 @U345 at U345@U345@@python at boost@@@python at boost@@@?$class_ at Vhello@?A0xc2d1617d@ @Unot_specified at detail@python at boost@@U3456 at U3456@@python at boost @@AEAAXAEBU?$init_base at V?$init at V?$basic_string at DU?$char_traits at D@std@ @V?$allocator at D@2@@std@@Uvoid_ at mpl@boost@@U345 at U345@U345 at U345@U345 at U345 @U345 at U345@U345 at U345@U345 at U345@U345@@python at boost@@@12@@Z) extending.obj : warning LNK4217: locally defined symbol ?function_object at objects@python at boost@@YA?AVobject at api@23 at AEBUpy_function @123 at AEBU?$pair at PEBUkeyword@detail at python@boost@@PEBU1234@@std@@@Z (class boost::python::api::object __cdecl boost::python::objects::function_object(struct boost::python::objects::py_function const &,struct std::pair const &)) imported in function "class boost::python::api::object __cdecl boost::python::detail::make_function_aux,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &>,struct boost::mpl::int_<0> >(class std::basic_string,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies const &,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &> const &,struct std::pair const &,struct boost::mpl::int_<0>)" (??$make_function_aux at P6A?AV?$basic_string at DU ?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@?A0xc2d1617d@ @@ZUdefault_call_policies at python@boost@@U?$vector2 at V?$basic_string at DU ?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@?A0xc2d1617d@@@mpl at 7 @U?$int_@$0A@@97@@detail at python@boost@@YA?AVobject at api@12 at P6A ?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@ZAEBUdefault_call_policies at 12@AEBU?$vector2 at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@mpl at 2@AEBU?$pair at PEBUkeyword@detail at python@boost@@PEBU1234@ @6 at U?$int_@$0A@@mpl at 2@@Z) extending.obj : warning LNK4217: locally defined symbol ?function_object at objects@python at boost@@YA?AVobject at api@23 at AEBUpy_function @123@@Z (class boost::python::api::object __cdecl boost::python::objects::function_object(struct boost::python::objects::py_function const &)) imported in function "class boost::python::api::object __cdecl boost::python::detail::make_function_aux,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &> >(class std::basic_string,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &),struct boost::python::default_call_policies const &,struct boost::mpl::vector2,class std::allocator >,class `anonymous namespace'::hello const &> const &)" (??$make_function_aux at P6A ?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@ZUdefault_call_policies at python@boost@@U?$vector2 at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@mpl at 7@@detail at python@boost@@YA?AVobject at api@12 at P6A ?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@ZAEBUdefault_call_policies at 12@AEBU?$vector2 at V ?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@AEBVhello@ ?A0xc2d1617d@@@mpl at 2@@Z) extending.obj : warning LNK4217: locally defined symbol ?copy_class_object at objects@python at boost@@YAXAEBUtype_info at 23@0 at Z (void __cdecl boost::python::objects::copy_class_object(struct boost::python::type_info const &,struct boost::python::type_info const &)) imported in function "private: static void __cdecl boost::python::objects::class_metadata::maybe_register_class_to_python(class `anonymous namespace'::hello *,struct boost::mpl::bool_<0>)" (??$maybe_register_class_to_python at Vhello @?A0xc2d1617d@@@?$class_metadata at Vhello@?A0xc2d1617d@@Unot_specified at detail @python at boost@@U3456 at U3456@@objects at python@boost@@CAXPEAVhello@?A0xc2d1617d@ @U?$bool_@$0A@@mpl at 3@@Z) extending.obj : warning LNK4217: locally defined symbol ?init_module at detail @python at boost@@YAPEAU_object@@AEAUPyModuleDef@@P6AXXZ at Z (struct _object * __cdecl boost::python::detail::init_module(struct PyModuleDef &,void (__cdecl*)(void))) imported in function PyInit_extending extending.obj : warning LNK4217: locally defined symbol ?scope_setattr_doc at detail@python at boost@@YAXPEBDAEBVobject at api@23 at 0@Z (void __cdecl boost::python::detail::scope_setattr_doc(char const *,class boost::python::api::object const &,char const *)) imported in function "void __cdecl boost::python::def,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &)>(char const *,class std::basic_string,class std::allocator > (__cdecl*)(class `anonymous namespace'::hello const &))" (??$def at P6A?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@ @std@@AEBVhello@?A0xc2d1617d@@@Z at python@boost@ @YAXPEBDP6A?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@ @AEBVhello@?A0xc2d1617d@@@Z at Z) extending.obj : *error LNK2019:* unresolved external symbol "__declspec(dllimport) void * __cdecl boost::python::objects::find_static_type(void *,struct boost::python::type_info,struct boost::python::type_info)" (__imp_?find_static_type at objects@python at boost@@YAPEAXPEAXUtype_info at 23@1 at Z) referenced in function "private: virtual void * __cdecl boost::python::objects::value_holder::holds(struct boost::python::type_info,bool)" (?holds@ ?$value_holder at Vhello@?A0xc2d1617d@@@objects at python@boost@ @EEAAPEAXUtype_info at 34@_N at Z) extending.obj : *error LNK2019:* unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception at boost@@YAXAEBVexception at std@@@Z) referenced in function "public: __cdecl boost::detail::shared_count::shared_count(void *,struct boost::python::converter::shared_ptr_deleter)" (??$?0PEAXUshared_ptr_deleter at converter@python at boost@@@shared_count at detail @boost@@QEAA at PEAXUshared_ptr_deleter@converter at python@2@@Z) extending.obj : *error LNK2019:* unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::converter::shared_ptr_deleter::shared_ptr_deleter(struct boost::python::converter::shared_ptr_deleter const &)" (__imp_??0shared_ptr_deleter at converter@python at boost@@QEAA at AEBU0123@@Z) referenced in function "public: __cdecl std::_Compressed_pair::_Compressed_pair(struct std::_One_then_variadic_args_t,struct boost::python::converter::shared_ptr_deleter &,void * &)" (??$?0AEAUshared_ptr_deleter at converter@python at boost@@AEAPEAX@ ?$_Compressed_pair at Ushared_ptr_deleter@converter at python@boost@@PEAX$0A@@std@ @QEAA at U_One_then_variadic_args_t@1 at AEAUshared_ptr_deleter@converter at python @boost@@AEAPEAX at Z) extending.obj : *error LNK2019:* unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::class_base::~class_base(void)" (__imp_??1class_base at objects@python at boost@@QEAA at XZ) referenced in function "public: __cdecl boost::python::class_::~class_(void)" (??1?$class_ at Vhello @?A0xc2d1617d@@Unot_specified at detail@python at boost@@U3456 at U3456@@python at boost @@QEAA at XZ) extending.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 (__cdecl*)(void *))" (__imp_?register_dynamic_id_aux at objects@python at boost@@YAXUtype_info at 23 @P6A?AU?$pair at PEAXUtype_info@python at boost@@@std@@PEAX at Z@Z) referenced in function "void __cdecl boost::python::objects::register_dynamic_id(class `anonymous namespace'::hello *)" (??$register_dynamic_id at Vhello@?A0xc2d1617d@@@objects at python@boost@ @YAXPEAVhello@?A0xc2d1617d@@@Z) extending.dll : fatal error LNK1120: 5 unresolved externals Finally, this is the output that I get when I follow the example of the documentation: *C:\lib\boost_1_67_0\libs\python\example\quickstart>bjam toolset=msvc --verbose-test -a test* warning: no Python configured in user-config.jam warning: will use default configuration ...found 34 targets... ...updating 12 targets... msvc.write-setup-script ..\bin\standalone\msvc\msvc-14.0\msvc-setup.bat compile-c-c++ extending.obj call "..\bin\standalone\msvc\msvc-14.0\msvc-setup.bat" x86 >nul cl /Zm800 -nologo @"extending.obj.rsp" ...failed compile-c-c++ extending.obj... ...skipped extending.pyd for lack of extending.obj... ...skipped test_ext for lack of extending.pyd... compile-c-c++ embedding.obj call "..\bin\standalone\msvc\msvc-14.0\msvc-setup.bat" x86 >nul cl /Zm800 -nologo @"embedding.obj.rsp" ...failed compile-c-c++ embedding.obj... ...skipped test_embed.exe for lack of embedding.obj... ...skipped test_embed.run for lack of test_embed.exe... ...failed updating 2 targets... ...skipped 6 targets... ...updated 2 targets... I would appreciate if somebody can give some clues on how to solve this issue. Thanks in advance, -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan at seefeld.name Sat Jul 14 11:47:08 2018 From: stefan at seefeld.name (Stefan Seefeld) Date: Sat, 14 Jul 2018 11:47:08 -0400 Subject: [C++-sig] Boost python undef symbols In-Reply-To: References: Message-ID: <766de542-93b6-b436-30b7-40e39e36794b@seefeld.name> On 07/13/18 08:41, Servando Arboli wrote: > > Dear all, > > I?m trying to install boost python in Windows but I must be doing > something wrong. The execution of b2 with python has produced a > library, but when I?m trying to link I get errors related to undefined > symbols. > > ? > > I?ve done a dumpbin /symbols with the library generated by b2, > filtering the undef symbols, I get plenty of them: > [...] Of course. Your code (as well as Boost.Python) is using symbols provided by other libraries, including the standard C++ library (which provides operator new and delete), and the Python library itself (which provides all the symbols starting with `__impl_Py`), so you need to make sure those libraries are linked to in your command-line. Stefan -- ...ich hab' noch einen Koffer in Berlin... -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.png Type: image/png Size: 1478 bytes Desc: not available URL: