I can't use boost/asio library properly. [closed]
Hello, I am working on a program where i need to get some datas from a PLC by using TCP/IP protocol. I viewed that related thread on this website. (https://answers.ros.org/question/1060...)
After some basic searchs, I decided to create an "adapter" process. And for that regard, I tried to use Boost/Asio library. For this, I visited this website (https://www.boost.org/doc/libs/1_75_0...)
But then strange things happen, after including the " boost/asio.hpp " to my program. I was not even able to create an boost::asio::io_context object. And I don't know why. I leave my basic program below. The problem might be related to my program's CMakeList.txt. How can i solve this problem and using Boost/Asio library properly for TCP/IP communication.
#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sstream>
#include <iostream>
#include <boost/asio.hpp>
using namespace std ;
int main(int argc, char **argv)
{
boost::asio::io_context io ; //THE PROBLEM HERE --> namespace "boost::asio" has no member "io_context"C/C++(135)
// boost::asio::ip::tcp::socket socket(io);
// boost::asio::steady_timer t(io, boost::asio::chrono::seconds(5));
while (ros::ok())
{
//some code
}
return 0;
}
UBUNTU 16.04 - Kinetic - Ros1. I use Visual Studio as IDE.
Thank You!