[C++-sig] Boost python undef symbols

2018-07-14 Thread Servando Arboli
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  UNDEF  notype ()External | ??2@YAPEAX_K@Z (void *
__cdecl operator new(unsigned __int64))

37D  UNDEF  notype ()External | ??3@YAXPEAX@Z (void __cdecl
operator delete(void *))

37E  UNDEF  notype ()External | atexit

37F  UNDEF  notype ()External | __std_terminate

380  UNDEF  notype   External |
__imp__invalid_parameter_noinfo_noreturn

381  UNDEF  notype   External | __imp_memmove

382  UNDEF  notype   External | __imp_PyObject_IsTrue

383  UNDEF  notype   External |
__imp_PyUnicode_FromStringAndSize

384  UNDEF  notype   External | __imp_PyLong_FromLong

385  UNDEF  notype   External |
__imp_PyLong_FromUnsignedLong

386  UNDEF  notype   External |
__imp_PyLong_FromUnsignedLongLong

387  UNDEF  notype   External | __imp_PyTuple_New

388  UNDEF  notype   External | __imp_PyErr_Occurred

389  UNDEF  notype   External | __imp_PyObject_Size

…

…

…

124  UNDEF  notype ()External | ?getattr@api@python@boost
@@YA?AVobject@123@AEBV4123@PEBD@Z (class boost::python::api::object __cdecl
boost::python::api::getattr(class boost::python::api::object const &,char
const *))

18C  UNDEF  notype ()External | __CxxFrameHandler3

18D  UNDEF  notype ()External | __GSHandlerCheck_EH

18E  UNDEF  notype ()External | __security_check_cookie

465  UNDEF  notype   External | __imp__Py_NoneStruct

466  UNDEF  notype   External | __imp_PyDict_Type

467  UNDEF  notype   External | ??_7type_info@@6B@ (const
type_info::`vftable')

4A5  UNDEF  notype   External | __security_cookie

032  UNDEF  notype ()External | atexit

033  UNDEF  notype ()External | __std_terminate

034  UNDEF  notype   External | __imp_PyObject_CallFunction

035  UNDEF  notype ()External |
?throw_error_already_set@python@boost@@YAXXZ (void __cdecl
boost::python::throw_error_already_set(void))

04C  UNDEF  notype ()External | __CxxFrameHandler3

0AC  UNDEF  notype   External | __imp__Py_NoneStruct

0AD  UNDEF  notype   External | __imp_PyLong_Type

0BE  UNDEF  notype ()External | atexit

0BF  UNDEF  notype ()External | __std_terminate

0C0  UNDEF  notype   External | __imp_PyLong_AsSsize_t

0C1  UNDEF  notype   External | __imp_PyLong_FromLongLong

0C2  UNDEF  notype   External | __imp_PyList_New

0C3  UNDEF  notype   External | __imp_PyList_Insert

0C4  UNDEF  notype   External | __imp_PyList_Append

0C5  UNDEF  notype   External | __imp_PyList_Sort

0C6  UNDEF  notype   External | __imp_PyList_Reverse

0C7  UNDEF  notype   External | __imp_PyErr_Occurred

0C8  UNDEF  notype   External | __imp_PyEval_CallFunction

0C9  UNDEF  notype   External | __imp_PyObject_Call

0CA  UNDEF  notype   External | __imp_PyObject_CallFunction

0CC  UNDEF  notype ()External | ?lookup@registry
@converter@python@boost@@YAAEBUregistration@234@Utype_info@34@@Z (struct
boost::python::converter::registration const & __cdecl
boost::python::converter::registry::lookup(struct boost::python::type_info))

0CD  UNDEF  notype ()External |
?throw_error_already_set@python@boost@@YAXXZ (void __cdecl
boost::python::throw_error_already_set(void))

0E7  UNDEF  notype ()External | ?getattr@api@python@boost
@@YA?AVobject@123@AEBV4123@PEBD@Z (class boost::python::api::object __cdecl
boost::python::api::getattr(class boost::python::api::object const &,char
const *))

12E  UNDEF  notype ()External | __CxxFrameHandler3

38C  UNDEF  notype   External | __imp__Py_NoneStruct

38D  UNDEF  notype   External | __imp_PyList_Type

38E  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"*



exte

Re: [C++-sig] Boost python undef symbols

2018-07-14 Thread Stefan Seefeld
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...


___
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig