undefined references to libc++ inlines when linking executable

symbols for libc++ mostly start with std::__1:: which is a result of using inline namespaces. It seems you are getting libstdc++ headers instead for some of your code.