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.


bjam address-model=32 runtime-link=shared toolset=msvc-12.0

C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\INCLUDE\xtgmath.h(206) : warning C4273: 'round' : inconsistent dll
        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

"C:\Users\MARK~1.INC\AppData\Local\Temp\b2_msvc_12.0_vcvarsall_x86.cmd" >nul
cl /Zm800 -nologo

...failed compile-c-c++

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.


Sent from

Boost list run by bdawes at, gregod at, cpdaniel at, john at