I'm trying to parse a YAML config file using yaml-cpp for a small raspberry pi3 project that I'm working on, but strangely, the member function LoadFile from YAML appears not to be member of YAML.
I'm using the following instruction, just as the tutorial Here explains,
YAML::Node testconfig = YAML::LoadFile("config.yaml");
And the error points directly to it:
error: 'LoadFile' is not a member of 'YAML'
Here is how my CmakeLists.txt looks like:
project("test" C CXX)
set(CMAKE_CXX_STANDARD 11)
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(yaml-cpp REQUIRED yaml-cpp)
find_library(wiringPi_LIB wiringPi yaml-cpp)
include_directories(include
${YAML_CPP_INCLUDE_DIR}
)
add_executable(${PROJECT_NAME} src/Moisture.cpp
)
target_link_libraries(${PROJECT_NAME} pthread ${wiringPi_LIB} YAML_LIB yaml-cpp)
I'm including the yaml-cpp library with:
#include <yaml-cpp/yaml.h>
So, the question is: What am I doing wrong? Is it the CMakeLists.txt that is wrong?
Best regards,
C.