Xcode with Boost:Linker(Id) Warning About Visibility Settings

xcode with boost : linker(Id) Warning about visibility settings

Doe just figured how to get rid of hundreds of warning like this :
set for an entire target or project with the Symbols Hidden by Default build setting to YES

Visibility linker warnings when compiling iOS app that uses Boost

The problem was that the Boost build script used clang++ as the compiler, but the other library and my own iOS app used clang (the other library and my app are Xcode projects where builds are made with clang).

The warnings disappeared after I rebuilt Boost with clang.

The sad thing is that I don't know exactly why this helped. I am aware that compiling with clang++ switches the compiler into C++ mode, turning on/off certain settings. But it certainly can't mean that using clang++ overrides visibility settings that are explicitly specified on the command line?! Comments or additional answers explaining the behaviour are welcome.

Strange warnings from the linker (ld)

The solution proposed by xcode with boost : linker(Id) Warning about
visibility settings doesn't work: "Symbols hidden by default" has
always been "YES".

This has less to do with being set to "YES", and more to do with being set to the same value across all projects. Libs/projects that depend on other libs need to have a likewise setting for "Symbols hidden by default" in order to link properly and free of errors/warnings.

I've run into this before, and a simple change in Xcode for all projects to ensure the settings match typically resolves the problem. Since it sounds like you're compiling on the command line as well, the -fvisibility argument to gcc is what you need to look at.

Linker warnings in xcode 6.4

I got rid of these linker warnings by changing "Symbols hidden by default" to "YES" and "Inline Methods Hidden" to "YES" in xcode build settings.

The boost library for iOS was built with -fvisibility=hidden -fvisibility-inlines-hidden flags and xcode build settings had symbols visibility set to YES. Hence there was a mismatch and linker warnings.

Symbol visibility linker warnings in Xcode 4.4

It turns out I needed to remove -fvisibility-inlines-hidden from both my .framework build and the .app build, this made the warnings disappear.



Related Topics



Leave a reply



Submit