How to write a library in ROS? [closed]
Hi, I am trying to write my own ros library. Just a ROS package containing a .hpp, a .cpp and the compiled library of the cpp.
I put the cpp inside the src folder, the hpp into the include directory and added the add_library command to the CMakeLists.txt, and the shared object file is created. But now I want to get this library used by another package. I added the library package to its manifest.xml. And it does not find the header file of the library package. I can make it link the library with multiple commands in the CMakeLists but then I still do not get the header file.
I found a tutorial on github: Tutorial
It says that something needs to be added to the manifest.xml, but unfortunately the line telling that is missing. (The line was removed because of the tags I guess)
I guessed it might be the <export> tag like this:
<export>
<cpp cflags="-I${prefix}/include/ -I${prefix}/include/NameOfLib" lflags="-L${prefix}/lib -Wl,-rpath,${prefix}/lib -lNameOfLib"/>
</export>
But it doesn't work.
Can anybody help me with that?
Thanks.