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
Convert a Single Color with Cvtcolor
How to Pass a Vector of Strings to Execv
Loop Until Integer Input Is in Required Range Fails to Work with Non-Digit Character Inputs
How to Provider User with Autocomplete Suggestions for Given Boost::Spirit Grammar
How to Cast a Derived Class to a Private Base Class, Using C-Style Cast
Why Do Some Experienced Programmers Write Comparisons with the Value Before the Variable
C++ "Error: Passing 'Const Std::Map<Int, Std::Basic_String<Char> >' as 'This' Argument of ..."
C++ Method Only Visible When Object Cast to Base Class
Any Solution to Unpack a Vector to Function Arguments in C++
Write Concurrently Vector<Bool>
In C++ What Causes an Assignment to Evaluate as True or False When Used in a Control Structure
Why Doesn't Emplace_Back() Use Uniform Initialization
When Can You Omit the File Extension in an #Include Directive
Which C++ Signals/Slots Library Should I Choose
Do Child Threads Exit When the Parent Thread Terminates
Should I Delete the Move Constructor and the Move Assignment of a Smart Pointer
Linking with Clang++ on Os X Generates Lots of Symbol Not Found Errors