# I can't add a library to my workspace. Can someone help me out, please? [closed]

Hello all, my problem seems very easy but I can't handle for 2 days. I just want to add a library to my program. The library's name is asio. What I want to do is exactly shown in this video( https://www.youtube.com/watch?v=2hNdk... ) (ONLY time between 2:30~5:20)

What I did so far? I downloaded the zip file of asio library like said in the video and unzip it. Then I copy the include folder that is in the folder that I just unzip to usr/include/serhat folder.(serhat folder is a just empty folder to store this library) Then I include all .hpp files to my programs. After including header files, I can use benefits this library and even my IDE start showing shortcuts of the objects related to this library. But then I made catkin_make and I got some fatal errors written below:

/home/serhatsony/catkin_ws/src/using_markers/src/tcp_learning_04.cpp:41:30: fatal error: asio/awaitable.hpp: No such file or directory
compilation terminated.


How should I solve this problem? I am open for all kind of answers. How can I do what the guy did in this video on my Ros/Linux?

UBUNTU 16.04 - Kinetic - Ros1. I use Visual Studio as IDE.

Thank You!

edit retag reopen merge delete

### Closed for the following reason duplicate question by serhat close date 2021-04-27 08:33:09.853435

What package are you trying to build using catkin_make? Did you copy the above file to the package you are trying to build?

( 2021-01-28 00:53:15 -0600 )edit

Hello Shubham, thank you for your comment firstly. I downloaded the asio library. And it includes a lot files inside itself. I don't know which one I should include? In the video I mentioned, the guy links to "include" file in the asio library to directly his SDK. This library is actually header based so I should add this library by typing "#include <asio.hpp>" in my program. But of course I should indicate where the asio library that I downloaded is properly in my laptop. So, I copy to asio library to my usr/include file, thus I'd be able to use this library with normal condition. Isn't it? I guess there is something needed I need to do in CMakeList.txt or package.xml file. If you can suggest me a tutorial about that, I am very open. Thank you again.

( 2021-01-29 00:48:39 -0600 )edit

Sort by » oldest newest most voted

Hi all again, I solved my problem and wanted to add the solution here as well. In shortly, I downloaded asio library as standalone and unzip it. I created a directory called "asio" in my usr/include directory. After unzipping the library, I copy these files(asio-1.18.1/include/asio and asio-1.18.1/include/asio.hpp) to my usr/include/asio directory which I just created by myself. Since asio library is based on header files, I am able to use benefits of asio library now by just adding these includes:

#include <asio/asio.hpp>
#include <asio/ts/buffer.hpp>
#include <asio/ts/internet.hpp>


I don't get any compiler error now. As you can see in my solution, I did not change anything in my CMakeList.txt or package.xml files. This is how I solved my problem. I hope that it works for you too.

more