ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

linking to libserial, "undefined reference to `LibSerial::..." , Melodic, Error.

asked 2019-09-12 16:02:12 -0500

Dragonslayer gravatar image

Hi, I installed libserial from source. Now I got "undefined reference to `LibSerial..." Errors. I searched for the problem but the mentioned "solution" mentioned in this post link text doesnt work. Where to link to the headers and where to see where they actually are on my system? Thanks

edit retag flag offensive close merge delete


I found a solution (on the worst designed site on the web). Happy to share link text

I leave the question open and unanswered as this solution seems suboptimal (direct linking to headers), and it would be great if someone in the know could provide a good link or answer-post on this important and very frustrating issue, describing a professional solution, best practice, etc.

Dragonslayer gravatar image Dragonslayer  ( 2019-09-13 17:30:11 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-10-05 14:14:36 -0500

rajmohan747 gravatar image

I have faced similar issues recently.Try removing libserial using apt, then install the current library using the instructions

Remove with apt using

sudo apt remove libserial-dev

Now install libserial using the following steps (with sudo permissions)

        mkdir serial_dir
        cd serial_dir/ && git clone
        cd serial_dir && cd libserial && ./
        cd serial_dir && cd libserial && cd build && make install

Now you should be able to find libserial under /usr/local/include

In the CMakelist.txt

  ${catkin_LIBRARIES} serial

In package.xml


Now,try building the package and it should work..!!

edit flag offensive delete link more

Question Tools



Asked: 2019-09-12 16:02:12 -0500

Seen: 563 times

Last updated: Oct 05 '22