![](/img/trans.png)
[英]Catch2 Framework Error: unknown type name 'DNA'clang-tidy(clang-diagnostic-error)
[英]clang-tidy bundled with Qt Creator [clang-diagnostic-error]
我有一個 CMake 項目,我嘗試在構建過程中運行 clang-tidy 檢查和修復。 一切都適用於安裝 brew 的 llvm 12.0.1(也嘗試過 11.0.0)的 clang-tidy。
當我嘗試使用 Qt Creator 附帶的 clang-tidy(來自 Qt Creator 5.0.0 beta 的 11.0.0 和 12.0.0)以便使用該項目的人不必安裝它時,我收到錯誤:
licensing.h:3:10: error: 'string' file not found [clang-diagnostic-error]
#include <string>
^
CMakeLists.txt 部分如下所示:
set(CMAKE_CXX_CLANG_TIDY
${CLANG_TIDY_BIN}
--format-style=file
--header-filter
--config=
--fix
)
你不包括系統庫文件。 您應該按如下方式包含目錄:“-Iexternal/llvm_toolchain_llvm/include/c++/v1/”、“-Iexternal/llvm_toolchain_llvm/include/x86_64-unknown-linux-gnu/c++/v1/”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.