Hello,
I had the same issue that you had. What I found is that ROS has all their C++ libraries under /opt/ros/[version]/lib
. What you need to link to get ROS working is roscpp, rostime, rosconsole, roscpp_serialization, and boost_system. Include the ros headers to your project. They are under /opt/ros/[version]/include
.
To make ROS recognize that you have a project place an xml file called package.xml and load it the basic data for it to work. Then you need to set a ROS package path to the directory above the project root.
For example if your project is under ~/git/my_ros_project
you need to have the ROS_PACKAGE_PATH
environment variable set to export ROS_PACKAGE_PATH=~/git:$ROS_PACKAGE_PATH
. Then under the ~/git/my_ros_project
you need an project.xml file.
You can checkout my repository for a relative decent template structure if you need help. https://git.root3287.site/Root3287/RO.... Then look into the premake5.lua file and see how the project is set up. All that is currently missing is generating MSG and SRV files which could be generated by the rosrun gencpp gen_cpp.py
command.
I hope this helps!
Edit 1: From the comments, if you installed ROS anywhere else, you need to change the /opt/ros
to where ever you installed ros. Check comments.
I'm not sure this is what the OP is looking for, but the go-to answer for "can I build ROS nodes without using Catkin" is typically a reference to gerkey/ros1_external_use.
And as a result of this discussion on ROS Discourse, @gerkey added the Writing a Simple Publisher and Subscriber (C++) (plain cmake) tutorial to the ROS wiki.
This might also provide some insight.