Home  >  Article  >  Backend Development  >  Why Does Boost::Program_Options Fail to Link When Using Clang with libc in C 0x Mode?

Why Does Boost::Program_Options Fail to Link When Using Clang with libc in C 0x Mode?

Barbara Streisand
Barbara StreisandOriginal
2024-11-03 20:08:29999browse

Why Does Boost::Program_Options Fail to Link When Using Clang with libc   in C  0x Mode?

Why does the boost::program_options fail to link when using clang with libc in c 0x mode?

Despite compiling boost using clang with the libc library, the code linking fails when using clang in c 0x mode. This is because libc is not binary compatible with gcc's libstdc . While the API of std::string remains the same, its ABI is modified using C 11's inline namespace feature, leading the linker to treat std::string and std::__1::basic_string as distinct data structures. This prevents a successful link between the binary and the library.

The above is the detailed content of Why Does Boost::Program_Options Fail to Link When Using Clang with libc in C 0x Mode?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn