how to include path to external libraries used by nodes?
Hi,
I have created a function in C++11 that uses Armadillo linear algebra library. If I have to comile the code from terminal successfully, I use the following line
g++ -std=c++11 -I/home/myname/armadillo/include mycode.cpp mycode.o -llapack -lblas
Now I want to use the same code as a ROS publisher node. For that I have created a ROS package and copied mycode.cpp file inside the src folder of the package that I have created. Then I add add_compile_options(-std=c++11) to the CMakeLists.txt file. Next I do catkin_make to build ROS workspace with the newly created package. And I receive the following error
error: could not convert ‘{-9.8e-1, 1.4e-1, 3.6e-2, {1.4e-1, 9.8e-1, -6.5e-2}, {-1.1e+0}}’ from ‘<brace-enclosed initializer list>’ to ‘arma::mat {aka arma::Mat<double>}’
I understand the error is because Armadillo library. In my view I need to show the path /home/myname/armadillo/include
somewhere inside the CMakeLists.txt file but not sure how to do that. It would be very helpful if somebody help me on the problem?
Thank you in advance.