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

Compilation problem with WiringOP library

asked 2017-12-31 01:31:57 -0500

Amrello gravatar image

Hello everyone, I have a question. How to add dependencies for package. For example, when I compilling program that used WiringOP library:

g++ progname.cpp  -lwiringPi -lpthread

So, question is how to add this dependencies in catkin workspace.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-01-03 10:24:05 -0500

You'll want to add the names of the libraries you need to link against to the target_link_libraries tag for the node in your CMakeLists.txt file as shown below:

Change the line:

add_executable(<your_node_name> src/progname.cpp)
target_link_libraries(<your_node_name> ${catkin_LIBRARIES})

To:

add_executable(<your_node_name> src/progname.cpp)
target_link_libraries(<your_node_name> ${catkin_LIBRARIES} wiringPi pthread)

Hope this helps.

edit flag offensive delete link more

Comments

Already compilled 2 days ago, but thanks

Amrello gravatar image Amrello  ( 2018-01-03 11:16:50 -0500 )edit

If you figure out an answer to your own question its helpful if you come back and share it with everyone, in case it could help others.

ufr3c_tjc gravatar image ufr3c_tjc  ( 2018-01-03 19:37:49 -0500 )edit

Question Tools

Stats

Asked: 2017-12-31 01:31:57 -0500

Seen: 220 times

Last updated: Jan 03 '18