Boost C++ Libraries: Ticket #13048: Static libraries and visibility hidden https://svn.boost.org/trac10/ticket/13048 <p> I've been told that I can compile the Boost libraries with "-fvisibility=hidden". But I think it will work only for shared libraries, and I am building static libraries. </p> <p> If I'm wrong, please point out what I am missing. I will use the Filesystem library as an example, but I think this applies to Boost in general. </p> <p> There are a number of functions that need to have default visibility to allow the libraries to link with other code without error. These functions have the BOOST_FILESYSTEM_DECL macro in their declaration. I am using Xcode. The config/compiler/clang.hpp file has defined BOOST_SYMBOL_EXPORT with the attribute-visibility-default setting. So I look for code that sets BOOST_FILESYSTEM_DECL to be BOOST_SYMBOL_EXPORT. </p> <p> When I look at the filesystem/config.hpp file, BOOST_FILESYSTEM_DECL is blank, unless (BOOST_ALL_DYN_LINK or BOOST_FILESYSTEM_DYN_LINK) and BOOST_FILESYSTEM_SOURCE are set. But with static libraries, I don't want those settings, right? </p> <p> There is another preprocessor macro called BOOST_SYMBOL_VISIBLE, but it is only used one place in filesystem (for the filesystem_error class). </p> <p> Any help in the right direction would be appreciated. Or if this is an oversight, that would be helpful to know. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13048 Trac 1.4.3 Braden McDaniel <braden@…> Tue, 17 Jul 2018 18:42:58 GMT cc set https://svn.boost.org/trac10/ticket/13048#comment:1 https://svn.boost.org/trac10/ticket/13048#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">braden@…</span> added </li> </ul> Ticket