背景:
在进行CMU15445实验的时候
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
CMake Warning at CMakeLists.txt:47 (message):
!! We recommend that you use clang-14 for developing BusTub. You're using
GNU 11.2.0, which is not clang.
尝试解决:
sudo update-alternatives --config c++
sudo update-alternatives --config cc
以上方法虽然能把编译器选到clang,但不能选到14
真正解决
(1)首先通过以前的方法安装clang-14
解决[ Ubuntu ]E: Unable to locate package clang-14
(2)install
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-14 30
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-14 30