ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Compilation problem with WiringOP library

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

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

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

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})


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


Already compilled 2 days ago, but thanks

Amrello gravatar image Amrello  ( 2018-01-03 11:16:50 -0600 )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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


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

Seen: 157 times

Last updated: Jan 03 '18