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

How to link exe in Cmakelist.txt in ROS

asked 2017-06-15 07:41:34 -0600

can-43811 gravatar image

updated 2017-06-16 04:20:01 -0600

gvdhoorn gravatar image

Hi, How to link exe file in CMakelist.txt in ROScpp . Usually we define the source file path (.cpp and .h header)only in Cmakelist but in case if exe file itself being used in source file then how to add rule in Cmakelist.txt.

Below is the rule:

add_executable(property_node ${$LOGG4CPP}_SOURCES} wrapper.cpp main.cpp wrapper.h)

in wrapper.cpp i have been referring one exe in system API inside my code . Through command line i am able to execute the code but in ros getting below error while running the node.

rosrun logpkg property_node

sh: 1: ./parse : not found . Here parse is a exe name which is being used in wrapper.cpp file through system API.
string string_output = "./parse  {args} "
system(string_output.c_str());
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-06-16 04:28:20 -0600

gvdhoorn gravatar image

updated 2017-06-16 04:30:43 -0600

Please see if #q235337 answers your question.


Edit:

How to link exe file in CMakelist.txt in ROScpp

just a note on this: you can't really 'link' a binary into another binary like this. Or at least, it won't do what you seem to be after.

Your problem is more one of paths / current working directory, which is resolved in a different way.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-06-15 07:41:34 -0600

Seen: 151 times

Last updated: Jun 16 '17