Boost logo

Boost Users :

Subject: Re: [Boost-users] boost unit test framework exports std::basic_ostringstream
From: Sascha Kremers (Sascha.Kremers_at_[hidden])
Date: 2016-06-30 08:28:02


Am 29.06.2016 um 18:28 schrieb Gennadiy Rozental:
> Sascha Kremers <Sascha.Kremers <at> gns-mbh.com> writes:
>
>> The boost unit test framework exports std::basic_ostringstream to the dll.
>> This causes linker errors on visual studio 2012 (LNK 2005), if the
>> tested code contains std::basic_ostringstream.
>>
>> You can confirm the symbol std::basic_ostringstream is in
>> boost_unit_test_framework-vc110-mt-1_61.dll by using dependency walker.
>>
>> I have the same problem with my self-built dlls as well as the ones
>> downloaded from
>> https://sourceforge.net/projects/boost/files/boost-binaries/.
>>
>> Is this a problem with boost or did I configure the build wrong?
> I suspect the problem is rooted in the fact that you are mixing two different
> VC++ runtimes. some.lib Is static library built against static runtime while
> Boost.Test DLL is built against shared one.
>
> Gennadiy
I built the some_test.exe, some.exe and some.lib with /MD
(Multi-Threaded DLL).
I built the boost libs with runtime-link=shared.
All are built and linked by VC11 (Visual Studio 2012).

dumpbin /symbols on some.lib
marks the problematic symbols as external. So I don't think they use the
runtime dynamically.

Do you think, it is okay for the boost_unit_test dll to export the
following functions?

??0?$basic_ostringstream_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QEAA@$$QEAV01@@Z

std::basic_ostringstream<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_ostringstream<char,struct
std::char_traits<char>,class std::allocator<char> >(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &,int)

std::basic_ostringstream<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_ostringstream<char,struct
std::char_traits<char>,class std::allocator<char> >(int)

As I understand, these symbols should only be exported by the runtime
library.

Sascha


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