Boost logo

Boost :

Subject: [boost] Fwd: Boost.Python build error in 1.58 RC1, 2 and 3 (OK in Beta 1)
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2015-04-08 10:35:44


---------- Forwarded message ----------
From: <mark.incley_at_[hidden]>
Date: Wed, Apr 8, 2015 at 1:29 AM
Subject: Boost.Python build error in 1.58 RC1, 2 and 3 (OK in Beta 1)
To: mclow.lists_at_[hidden]

Hi Marshall,

Please excuse the direct mail, but my mailing list posting wasn't picked up
on by anyone. I believe I've found a problem in Boost.Python that causes
build errors if the user has Python 3.0 or later on their system. This
change appears to have been introduced after 1.58 Beta 1.

Using:

bjam address-model=32 runtime-link=shared toolset=msvc-12.0
--stagedir=./stage/x86

C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\INCLUDE\xtgmath.h(206) : warning C4273: 'round' : inconsistent dll
linkage
        C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\INCLUDE\math.h(516) : see previous definition of 'round'
libs\python\src\exec.cpp(91) : error C2664: 'FILE *_Py_fopen(PyObject
*,const char *)' : cannot convert argument 1 from 'char *' to 'PyObject *'
        Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast

    call
"C:\Users\MARK~1.INC\AppData\Local\Temp\b2_msvc_12.0_vcvarsall_x86.cmd" >nul
cl /Zm800 -nologo
@"bin.v2\libs\python\build\msvc-12.0\debug\link-static\threading-multi\exec.obj.rsp"

...failed compile-c-c++
bin.v2\libs\python\build\msvc-12.0\debug\link-static\threading-multi\exec.obj…

The problem appears to be this Boost.Python code that was changed some time
after 1.58 Beta 1 and appears in 1.58 RC1 within
boost\libs\python\src\exec.cpp at around line 91:

1.58 beta 1: FILE *fs = fopen(f, "r");
1.58 RCs: FILE *fs = _Py_fopen(f, "r"); ← f is a char *, hence the error
shown above. It expects a PyObject * as the first parameter.

This code occurs within a test for #if PY_VERSION_HEX >= 0x03000000 which
may explain why no-one else has reported it – I have Python 3.3.0 on my HDD.

Cheers,
Mark.

_____________________________________
Sent from http://boost.2283326.n4.nabble.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk