Why do I get "ld: warning: direct access in _main to global weak symbol" in this simple code?
<p>It's very strange behavior in my Clang compiler. I use Xcode (OS X), all is up-to-date. Why am I getting this warning in that simple code? If I remove those two lines the warning hides.</p>

<blockquote>
  <p>ld: warning: direct access in _main to global weak symbol
  std::__1::char_traits::eq(char, char) means the weak symbol
  cannot be overridden at runtime. This was likely caused by different
  translation units being compiled with different visibility settings.</p>
</blockquote>

<pre><code>int main( int argc, char* argv[] ) {
    std::string file = "test";
    size_t pos = file.find( "a" );
    return 0;
}
</code></pre>