Boost logo

Boost Users :

Subject: Re: [Boost-users] Why I had to use-D_GLIBCXX_USE_CXX11_ABI=0 to get a Boost.Test unit test to build and run
From: Andrew King (eurokang_at_[hidden])
Date: 2018-08-20 06:42:15

Are you sure you are actually using the new boost unit test you built,
rather than some system installed one? Check with ldd which actual
boost_unit_test_framework you are loading when you run the executable.

The other question is when you invoke b2 is it using your custom gcc-8.2 or
system gcc-4.8.5?


On Sun, Aug 19, 2018 at 12:00 PM Arved Sandstrom via Boost-users <
boost-users_at_[hidden]> wrote:

> This is in the nature of a question, I am wondering *why* I had to use the
> -D_GLIBCXX_USE_CXX11_ABI=0 setting.
> This development is happening on Centos 7, where the system gcc/g++ is
> 4.8.5. So I recently built and installed gcc/g++ 8.2.0 from source, because
> I like Linux and prefer to try out C++17 stuff there rather than using a
> recent Visual Studio. That's just background.
> In any case I built the Boost Test module with
> ./b2 cxxflags="-stdlib=libc++ -std=c++14" linkflags="-stdlib=libc++
> -std=c++14"
> going off suggestions I found. No evident problems there. After the
> install, among other things I end up with
> /usr/local/lib/
> Now, I attempted to build a unit test with
> g++ -std=c++14 DocumentTest.cpp ../src/Document.cpp -I../include
> -L/usr/local/include -DBOOST_TEST_DYN_LINK -lboost_unit_test_framework
> The linker complained about an undefined reference for
> boost::unit_test::ut_detail::normalize_test_case_name[abi:cxx11](boost::unit_test::basic_cstring<char
> const>)
> Using nm -D on the shared library I see that the proper export symbol is
> there. abi:cxx11 seemed to offer some indication as to the problem, which
> is why after some experimentation I found that adding
> -D_GLIBCXX_USE_CXX11_ABI=0 to the unit test build command did the trick.
> The resulting a.out executes just fine (purely for debugging I made sure
> the unit test had a C++14 feature).
> I thought I sort of understood the ABI change business, gcc 5.1 before and
> after, but I guess I don't. What do I need to do, perhaps at the stage of
> building a Boost shared library, to not have to use that flag?
> Thanks for any wisdom.
> Arved Sandstrom
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at