Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在编译 catch2 示例中的 010-TestCase.cpp 文件时遇到此错误。我对这个框架很陌生。如果有人对此有意见,请回复。猫
当使用具有 Catch2 的单头分发的示例与 CMake 安装相反时,这似乎是个问题。
对我来说,诀窍是-I$(CATCH_SINGLE_INCLUDE)从示例命令中删除违规行为。它没有出现在 Google 搜索中,但我希望它包含我几乎不包含为“catch2.hpp”的路径。
-I$(CATCH_SINGLE_INCLUDE)
在我完成后,测试对我有用:
g++ -std=c++11 -Wall -o 010-TestCase 010-TestCase.cpp && ./010-TestCase --success