Using C code in ROS, including a .c file in ROS
Hi,
I have a .c file (and a corresponding .h file) that has a function I would like to call inside my ROS package.
I altered the cmakelist.txt to include the .c file rosbuild_add_executable(myNodeName src/mainFile.cpp src/cFile.c)
This does not build however if I change the file's extension to cpp and then change the corresponding rosbuild statement it builds fine.
I looked at "how-to-develop-interface-from-c-program-with-ros" and "shell-script-and-c-program-in-ros" on this site.
Is my only option to build a wrapper for the .c file ?
All I had to do was add the c99 flags to the cmakelist file to make it work. add_definitions(-std=c99)
Canatan, you should include that response as an answer.
done thanks