ROS-kinetic (C++11) resource retriever undefined references
I need to get an MySQL query from a file. For that I a trying to use this example. But when I have resource_retriever::Retriever r;
in the code, I get the following errors.
resource_retriever::Retriever r;
is the line causing the error and I don't get it. Any idea? (The header files are included and the files are present - I checked)
[ 95%] Building CXX object xxxxx/CMakeFiles/xxxxx.dir/src/xxxxx.cpp.o
[100%] Linking CXX executable /home/teshanl/catkin_ws/devel/lib/xxxxxx/xxxxxx
CMakeFiles/xxxxxx.dir/src/xxxxxx.cpp.o: In function `main':
xxxxx.cpp:(.text+0xd9): undefined reference to `resource_retriever::Retriever::Retriever()'
xxxxx.cpp:(.text+0x132): undefined reference to `resource_retriever::Retriever::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const
&)'
xxxxx.cpp:(.text+0x1a0): undefined reference to `resource_retriever::Retriever::~Retriever()'
xxxxx.cpp:(.text+0x243): undefined reference to `resource_retriever::Retriever::~Retriever()'
collect2: error: ld returned 1 exit status
xxxxx/CMakeFiles/xxxxx.dir/build.make:117: recipe for target '/home/teshanl/catkin_ws/devel/lib/xxxxx' failed
make[2]: *** [/home/teshanl/catkin_ws/devel/lib/xxxxx] Error 1
CMakeFiles/Makefile2:1836: recipe for target 'xxxxx/CMakeFiles/xxxxxx.dir/all' failed
make[1]: *** [xxxxx/CMakeFiles/xxxxxx.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed