How to set up Clion with Clang-15 from llvm.org on Ubuntu?

已完成

I installed Clang-15 from llvm.org on Pop!_OS (Ubuntu) 22.04.  It works fine.  I can compile a Hello World program with clang++-15.

When I try to add Clang-15 to a toolchain, I get this error in Clion:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_C_COMPILER:

    /usr/bin/clang-15

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

/usr/lib/clang-15 and /usr/lib/clang++-15 exist and work.

I have been away from Clion for a while.  Did I forget a step?

 

0

Well, this turned out to be a waste of an afternoon.  I originally installed Clion through the Pop!_OS store, which uses Flatpak.  On a hunch, I uninstalled that version and installed directly from jetbrains.com.  No problems finding the version of Clang I installed from llvm.org.

0

请先登录再写评论。