-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linker/visibility warnings on macOS for boost log 1.68.0 #65
Comments
Boost.Log is always built with hidden visibility. As far as I can tell, the warning says that Boost.Log code uses direct access to its symbols, so they won't be overridden at run time, which is the intention. My advice would be to use hidden visibility everywhere, including your modules. Mark the symbols you need to export explicitly, with default visibility attributes or pragmas. |
Is there any particular reason I don't need to do this with a package manager-installed binary of Boost.Log? I only started seeing this when I started compiling Boost.Log myself. |
Sorry, I have no idea. I don't use Mac OS and I don't know how the packages are built there. The first Boost.Log release which had hidden visibility enabled was 1.59, so if your system packages are older, they were likely compiled with default visibility. |
Also, you might want to ensure that you're not linking with shared library when you build against the system libraries. In that case you probably won't get the warnings. |
I was using 1.66.0 previously installed through homebrew, so I don't know why that's different given what you've said. I think I've got enough info to sort out how my project needs to build given the visibility requirements, though, and thanks 👍 |
I'm trying to compile boost 1.68.0 from source for a project on macOS and I'm getting a pile of linker warnings. The warnings go away when I compile my project with
-fvisibility=hidden
(as expected) however, my project is multi-module and the library dependent on boost must itself be visible to a few other libraries and executables.What's going on here? Is there a way to address these errors?
Here's my configure and build commands:
And I'm linking these libraries:
boost_system, boost_thread, boost_filesystem, boost_locale, boost_log_setup, boost_log
The text was updated successfully, but these errors were encountered: