Boost logo

Boost :

Subject: Re: [boost] Including a system link library for every test, but only on mingw-w64 builds?
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2017-11-06 21:51:39


On 11/07/17 00:39, Robert Ramey via Boost wrote:
> On 11/6/17 12:48 PM, James E. King, III via Boost wrote:
>> Is BOOST_AUTO_LINK supposed to work on mingw-w64 builds with gcc?  I'm
>> guessing not since I believe this is a MSVC concept, so I am looking
>> for a
>> bjam recipe that will allow me to add the link library bcrypt.lib to
>> all of
>> the tests in a project's test directory if the build is on a windows
>> system
>> and not using msvc toolset.  Are these any examples out there?
>
> autolink isn't an just a msvc concept anymore.  The boost autolink
> supports two functions:
>
> a) creating and linking to a library with the correct abi
> b) making the symbols to be exported from the library and imported into
> the application visible.  This is not supported under the name
> "visibility" for gcc and clang compilers.

Autolinking (and the tool implemented in config/auto_link.hpp) has
nothing to do with exporting or importing symbols. For that you use
BOOST_SYMBOL_EXPORT/BOOST_SYMBOL_IMPORT, which are also provided by
Boost.Config but are not part of the autolinking.

You can see that gcc does not support autolinking from auto_link.hpp:

//
// Only include what follows for known and supported compilers:
//
#if defined(BOOST_MSVC) \
     || defined(__BORLANDC__) \
     || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \
     || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200))


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