作用
下载安装yaml-cpp库
sudo apt install libyaml-cpp-dev
CMakeLists.txt配置yaml-cpp依赖
cmake_minimum_required(VERSION 3.9.0)
project(pro_judge_path)
# set(path_to_third_party "${CMAKE_SOURCE_DIR}/third_party")
find_package(yaml-cpp REQUIRED)
if(NOT yaml-cpp_FOUND)
message("Not found yaml-cpp library")
endif()
set(CMAKE_CXX_STANDARD 20)
add_executable(exec_file yaml_create_file.cpp)
target_link_libraries(exec_file yaml-cpp)
引用头文件
#include <yaml-cpp/yaml.h>