Why this does not work:
#include <regex> int main() { return 0; }
Compiled as:
clang++ -std=c++11 -stdlib=libstdc++ temp.cpp temp.cpp:1:10: fatal error: 'regex' file not found
If I allow stdlib be libc++ , then it compiles. Regex c++11 , but clang doesn't seem to have a problem with both -std=c++11 -stdlib=libstdc++ per se. On my machine, at least it looks like what I can use in /usr/include/regex.h , but this is not standard, and there are also things other than the regular expression that I would like to use (e.g. std :: to_string).
The reason this happened is because I want to link a third-party library (for which I have no source) that matches std::string , not std::__1::basic_string , but my code uses std::regex and std::to_string . I'm not sure I want to imagine a dependency on the rise.
source share