Clang can't compile programs using the header anymore

前端 未结 1 1560
萌比男神i
萌比男神i 2020-12-11 18:09

I\'m using clang Version 4.0.0 on my system running ArchLinux, it always worked fine, but recently I can\'t compile programs that use certain STL headers anymor

相关标签:
1条回答
  • Your setup is messed up. Funny enough, I have the exact same problem.

    When you upgraded to gcc 7.1.1, libstdc++ (which is gcc's Standard Library) was updated alongside of it to provide the new features from C++17. Using gcc, this works, because it has almost full C++17 support.

    But clang doesn't. A hint is the -std=c++1z flag instead of gcc's -std=c++17 flag. Clang is missing deduction guides, and when it encounters them in libstdc++, it doesn't know what to do with them.

    You can install the old libstdc++ package from the ALA, or you can download/use LLVM's Standard Library libc++, which naturally has only partial C++17 features.

    0 讨论(0)
提交回复
热议问题