Boost logo

Boost Users :

Subject: Re: [Boost-users] questions about visibility/dlls under mingw
From: John Maddock (jz.maddock_at_[hidden])
Date: 2018-11-19 19:07:22

> OK - due to some sleuthing on the part of one of the auxiliary
> maintainers of the boost serialization library, it's seems that the
> problem is that
> BOOST_SYMBOL_IMPORT is not defined to be
> __attribute__((__dllimport__)) under MINGW and that is the source of
> the problem.

That's not true, gcc.hpp has:

#    define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__))
#    define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__))

when _Win32 is defined.

And if I modify config_info.cpp to print these out then I see:

 Â Â Â  BOOST_SYMBOL_EXPORT =__attribute__((__dllexport__))
 Â Â Â  BOOST_SYMBOL_IMPORT =__attribute__((__dllimport__))
 Â Â Â  BOOST_SYMBOL_VISIBLE =__attribute__((__visibility__("default")))

Which looks good to me.


> It's totally plausible since gcc visibility attributes are only
> applied to exports and it seems that in moving to windows this rule is
> carried over.  So I'm thinking that BOOST_SYMBOL_EXPORT needs to be
> updated for a special case of MINGW.
> Of course, this is subject to confirmation. Hope this is helpful.
> It's also been mentioned that the rules for application of these
> attributes might be different for functions and variables.  The
> thought of this makes me ill.  I don't know if it's true, but it's one
> more thing to keep things interesting.
> Robert Ramey
>> John.
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

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