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

Error: Config file has not been declared.

asked 2017-07-21 15:48:40 -0500

BhanuKiran.Chaluvadi gravatar image

updated 2017-07-21 17:17:27 -0500

allenh1 gravatar image

HI I am trying to build package: performance_test

It has a configuration file @ performance_test->cfg->performanceTest.cfg. package contains a simple publisher and subscriber.

Screen shot of my files is attached.Please zoom if isn't clear. Any help would be greatly appriciated.

Error: /home/nth/ocean_ws/src/performance_test/src/talker_node.cpp:21:41: error: ‘performance_test::performanceTestConfig’ has not been declared
   void configCallback(performance_test::performanceTestConfig &config, uint32_t level);

image description

image description

edit retag flag offensive close merge delete

Comments

@BhanuKiran.Chaluvadi: please don't use screenshots to show something that is just text. Copy-paste the text into your question body and use the Preformatted Text button (the one with 101010 on it) to format it correctly.

gvdhoorn gravatar image gvdhoorn  ( 2017-07-22 01:56:35 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-07-21 20:46:39 -0500

Haibo gravatar image

First, you should make sure the names defined in the cfg/performanceTest.cfg matches the names you used in you code. Then you can try these. In you CMakeLists.txt file, change line 30 to add_dependencies(talker ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS}). Then shift this line to before the line of target_link() command. Do the same thing for your listener. After changing the CMakeLists.txt, it should look like this,

add_executable(talker src/talker_node.cpp)
add_dependencies(talker ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(talker ${catkin_LIBRARIES})

add_executable(listener src/talker_node.cpp)
add_dependencies(listener ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
target_link_libraries(listener ${catkin_LIBRARIES})

Try to compile again, it may help.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-07-21 15:48:40 -0500

Seen: 1,224 times

Last updated: Jul 21 '17