Error Using yaml-cpp in ROS? -
i trying use yaml-cpp , according wiki, it's system dependency don't need change cmakelists.txt or manifest.xml. however, when compile code, still errors like:
/home/aramus/fuerte_workspace/sandbox/image_test/src/image_test.cpp:53: undefined reference `yaml::parser::parser(std::basic_istream<char, std::char_traits<char> >&)' /home/aramus/fuerte_workspace/sandbox/image_test/src/image_test.cpp:54: undefined reference `yaml::node::node()' /home/aramus/fuerte_workspace/sandbox/image_test/src/image_test.cpp:92: undefined reference `yaml::node::~node()' /home/aramus/fuerte_workspace/sandbox/image_test/src/image_test.cpp:92: undefined reference `yaml::parser::~parser()' /home/aramus/fuerte_workspace/sandbox/image_test/src/image_test.cpp:92: undefined reference `yaml::node::~node()' /home/aramus/fuerte_workspace/sandbox/image_test/src/image_test.cpp:92: undefined reference `yaml::parser::~parser()' /home/aramus/fuerte_workspace/sandbox/image_test/src/image_test.cpp:92: undefined reference `yaml::node::~node()' /home/aramus/fuerte_workspace/sandbox/image_test/src/image_test.cpp:92: undefined reference `yaml::parser::~parser()'
the code i've added cmakelists.txt are:
target_link_libraries(${project_name} yaml-cpp) rosbuild_add_executable(image_test src/image_test.cpp)
i using fuerte in linux. solutions anybody?
edit: have found solution! changed cmakelists.txt build executable first add yaml-cpp library!
rosbuild_add_executable(image_test src/image_test.cpp) target_link_libraries(image_test yaml-cpp)
those 2 lines in cmakelists.txt work fine!
those linker errors. make sure you're linking library including headers. link provided, appears in cmakelists.txt
file, need:
target_link_libraries(${project_name} yaml-cpp)
Comments
Post a Comment