I want to use a c library for a piece of c code in a ros node [closed]
Hello, as the title says I'm trying to create a ROS node that have some lines of C code inside that depend to an external C library. I'm getting errors in the console like: getvec (a particular function of that library) reference not defined. I think that my node doesn't read properly the library, am I right? I have included .so and .h files in the include folder of the package in which is my node, as suggested by some experienced ROS users, they told me that is enough to define a library (of course i used #include in the .cpp file). Maybe i have to modify also the CMakeLists.txt? Since i surfed some ROS wiki/answer pages and other sites that said so. Here is the code:
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "../include/heart_rate_monitor/wfdb.h"
#include <stdio.h>
#include <sstream>
int main(int argc, char **argv)
{
ros::init(argc, argv, "heart_rate_monitor");
ros::NodeHandle n;
int i;
WFDB_Sample v[2];
WFDB_Siginfo s[2];
if (isigopen("100s", s, 2) < 2)
exit(1);
for (i = 0; i < 10; i++) {
if (getvec(v) < 0)
break;
printf("%d\t%d\n", v[0], v[1]);
}
exit(0);
return 0;
}
Thank you in advance for your help! :)