undefined reference to `urdf::Model::initFIle()'
I am attempting to compile a cpp file that will read joint limits from a urdf. The lines of code at issue are:
urdf::Model robotModel;
robotModel.initFile("path/to/file");
I get the following error: undefined reference to `urdf::Model::initFile(std::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&)'
Commenting out 'robotModel.initFile(...)' eliminates the error, but defeats the purpose of the program.
The error appears while linking. It appears that I am passing in the proper argument- it seems to match the documentation. In my CMakeLists, I have 'link_directories(/opt/ros/hydro/lib/)', which I have confirmed contains libkdl_parser.so and liburdfdom_model.so. The same type of error occurs if I use .initString(). What am I missing?
Please post your CMakeLists.txt
The problem was in my CMakeLists.txt. Thank you for your comment.
Could you please post your CMakeLists? I have the same problem