根据文档,我有以下cmake项目
cmake_minimum_required(VERSION 3.5)
project(teeest LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(LLVM REQUIRED)
find_package(Clang REQUIRED)
add_executable(teeest main.cpp)
target_link_libraries(teeest
PRIVATE
clangAST
clangFrontend
clangTooling
)
但当我试图构建项目时,我会遇到以下错误
/usr/bin/ld: cannot find -lclangAST
/usr/bin/ld: cannot find -lclangFrontend
/usr/bin/ld: cannot find -lclangTooling
我已经从archlinux的存储库安装了llvm包
以下帮助我解决了错误:
find_package( LLVM REQUIRED CONFIG )
find_package( Clang REQUIRED CONFIG )