Boost logo

Boost Users :

Subject: Re: [Boost-users] Python TypeError with application compiled with CXX11_ABI=0
From: Jason Roehm (jasonr_at_[hidden])
Date: 2016-07-29 07:56:27


> On Jul 28, 2016, at 4:30 PM, Jackson Wiegman <jackson_at_[hidden]> wrote:
>
> Hi,
>
> I have an application I am trying to compile on Ubuntu 16.04. This is using GCC 5.4.0 and libboost 1.58.0 (stock libraries).
>
> The application has a linking to a library that was built with GCC 4.*, so I have to compile with D_GLIBCXX_USE_CXX11_ABI=0 to get backwards comparability (otherwise I have undefined abi:cxx11 links). However when I do this, I get a TypeError in Python:
>
> TypeError: No registered converter was able to produce a C++ rvalue of type std::string from this Python object of type str
>
> It looks like boost is having a problem working without the ABI. Does anyone have a work-around or a patch for this?
>

If you’re linking against the stock Ubuntu 16.04 Boost package, that could be an issue. The Ubuntu-packaged Boost is going to have been built with the distribution’s packaged gcc version (5.4.0). This version uses the new C++11 ABI by default (hence your need to define _GLIBCXX_USE_CXX11_ABI=0 when you build your application), so the “stock” Boost is going to be using the new ABI. You can force your application to use the old ABI, but the Boost libraries that you’re linking against (e.g. Boost.Python) are built against the new ABI. This is likely to cause problems.

Is this the root cause of your problem? I don’t know. But it’s worth building your own Boost with the appropriate _GLIBCXX_USE_CXX11_ABI=0 setting and see if it helps.

Jason



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net