Where does the __1 character come from when using LLVM libC ++?

I see many questions, such as Apple Link-Link (Id) Error and Undefined characters in cryptopp in a 64-bit iOS project . The problem is usually described as:

Undefined symbols for architecture i386: "std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from: cv::gpu::error(char const*, char const*, int, char const*) in opencv2(gpumat.o) 

The problem often comes down to mixing / matching -stdlib=libc++ (LLVM C ++ runtime) and -stdlib=libstdc++ (GNU C ++ runtime). The LLVM C ++ runtime ( libc++ ) has a decoration symbol __1 , but the libstdc++ runtime for GNU C ++ __1 not have the __1 symbol. This causes problems with linkers for characters that have the same name (for example, std::string ).

Where does the __1 character __1 when using LLVM libC ++?

Why hasn't the problem been resolved with the gnu namespace and llvm namespace?


Here is a related question: lib ++ - stop std renaming to std :: __ 1? . But it somehow misses the fact that the renaming does not occur.

+7
c ++ symbols libc ++ libstdc ++
source share
1 answer

This is from C ++ 11 nested namespaces

libc ++ has something like

 namespace std { inline namespace __1 { .... 

Further What are the built-in namespaces for?

+4
source share

All Articles