Where does the __1 symbol come from when using LLVM’s libc++?
It is from C++11 inlined namespaces libc++ has something like namespace std { inline namespace __1 { …. more at What are inline namespaces for?
It is from C++11 inlined namespaces libc++ has something like namespace std { inline namespace __1 { …. more at What are inline namespaces for?
If we look at the libstdc++ status we see that they do have support for the File System TS: Paper | Title | Status …….. N4100 | File System | Y but it says: This page describes the C++14 and library TS support in mainline GCC SVN, not in any particular release. and from trying … Read more
What you’re seeing is the use of inline namespaces to achieve ABI versioning. What that means: The libstdc++ std::string is a different data structure than the libc++ std::string. The former is a reference counted design, whereas the latter is not. Although they are API compatible, they are not ABI compatible. That means that if you … Read more
I would use the native library for each OS i.e. libstdc++ on GNU/Linux and libc++ on Mac OS X. libc++ is not 100% complete on GNU/Linux, and there’s no real advantage to using it when libstdc++ is more complete. Also, if you want to link to any other libraries written in C++ they will almost … Read more
The libstdc++ FAQ entry How do I insure that the dynamically linked library will be found links to the manual section Finding Dynamic or Shared Libraries which explains how to use RPATH instead. My preferred method is to use an RPATH of $ORIGIN which means that searching for dynamic library dependencies starts in the same … Read more
Here is a short program to help you explore both kinds of memory usage of std::string: stack and heap. #include <string> #include <new> #include <cstdio> #include <cstdlib> std::size_t allocated = 0; void* operator new (size_t sz) { void* p = std::malloc(sz); allocated += sz; return p; } void operator delete(void* p) noexcept { return std::free(p); … Read more
Anyway, the resulting artifacts appear to be linked with system default version of libstdc++: Yes. The devtoolset-6-gcc-c++ package provides a custom version of GCC that uses a special linker script instead of a dynamic library for libstdc++.so. That means the binaries it produces do not depend on the newer libstdc++.so.6 and can be run on … Read more
When you link with your own gcc you need to add an extra run-time linker search path(s) with -Wl,-rpath,$(PREFIX)/lib64 so that at run-time it finds the shared libraries corresponding to your gcc. I normally create a wrapper named gcc and g++ in the same directory as gcc-4.8 and g++-4.8 which I invoke instead of gcc-4.8 … Read more
To be honest, I don’t like the above answer, as it uses the static lib and not the dynamic! I have had the problem myself and found that the problem is that xcode is unable to find any C++ files in you project and thus assumes that the libstc++ is not needed! Quite annoying when … Read more
You shouldn’t have to manually download this library, if you’re on Ubuntu Linux, it should be shipped inside this package : sudo apt-get install libstdc++6 If you already have libstdc++6, then the problem is elsewhere and you should explain what you’re trying to achieve in the first place. If you want a newer version of … Read more