title: How to build google test with hidden visibility
body: <p>When I build unit tests for a library (which is built with hidden visibility), I encounter about 400 warnings of this format:</p>
  <pre class="lang-cpp prettyprint-override"><code>direct access in function 'testing::internal::SuiteApiResolver&lt;MyTestSuite&gt;::GetTearDownCaseOrSuite(char const*, int)' from file 'libgtestd.a(gtest-all.o)' to global weak symbol 'testing::Test::TearDownTestSuite()' from file 'test_filemame.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
  </code></pre>
  <p>By changing the googletest's option <code>gtest_hide_internal_symbols</code> from <code>OFF</code> to <code>ON</code>, the number of warnings greatly decrease. However, I still have some warnings of this type:</p>
  <pre class="lang-cpp prettyprint-override"><code>direct access in function 'testing::internal::SuiteApiResolver&lt;testing::internal::(anonymous namespace)::FailureTest&gt;::GetTearDownCaseOrSuite(char const*, int)' from file 'libgtestd.a(gtest-all.o)' to global weak symbol 'testing::Test::TearDownTestCase()' from file 'test_mytest.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
  </code></pre>
  <p>Can someone explain why the warnings still exist, when I already turn on <code>gtest_hide_internal_symbols</code> option? What am I missing?</p>