title: Symbol visibility using g++
body: <p>I compiled a C++ library under Linux/Mac with its symbols hidden. I've used <code>__attribute__ ((visibility(&quot;hidden&quot;)))</code> for all my classes and compiled with options (<code>-c -O2 -fPIC -MMD -MP -MF</code>). Under Mac, using  <a href="http://code.google.com/p/macdependency/" rel="nofollow noreferrer">MacDependencies</a>, the job is done just fine as I see only my exports (I actually saw the difference before and after).</p>
  <p>However, I noticed that using <code>nm</code> I still see all the names of the symbols. This happens under both Mac and Linux.</p>
  <p>Why is that? Is there any way to avoid this?</p>