Why do I get "ld: warning: direct access in _main to global weak symbol" in this simple code?

This is a very strange behavior in my Clang compiler. I am using Xcode (OS X), everything is updated. Why am I getting this warning in this simple code? If I delete these two lines, the warning is hidden.

ld: warning: direct access in _main to the global weak character std :: __ 1 :: char_traits :: eq (char, char) means a weak character cannot be overridden at run time. This is probably caused by translation units compiled with different visibility settings.

int main( int argc, char* argv[] ) {
    std::string file = "test";
    size_t pos = file.find( "a" );
    return 0;
}
+4
source share
2 answers

. Visibility @developer.apple.com.

, (, ++) , , , .

, , -fvisibility=hidden.

+3

, . , , , ?

0

All Articles