Linking against static library using Eigen produces many direct access ... to global weak symbol warnings

Alec Jacobson

April 13, 2012

weblog/

Our group builds a static library of useful functions implemented using the Eigen matrix library in C++. We build the library with a standard Makefile and gcc. But when I try to link against this library in an Xcode project (which also used Eigen) I got many warnings from the linker of the form:
ld: warning: direct access in void Eigen::internal::computeProductBlockingSizes<float, float, 4>(long&, long&, long&)to global weak symbol Eigen::internal::manage_caching_sizes(Eigen::Action, long*, long*)::m_l2CacheSizemeans the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
There seem to be no problems at runtime, but nonetheless it's annoying to have so many warnings. To make the warnings go away, I went to my project settings in Xcode and made sure that Symbols Hidden by Default was set to No. Xcode symbols hidden by default