在CMakeLists.txt文件中加入下面两句: link_directories(/usr/local/lib) include_directories(/usr/local/include/yaml-cpp)