Ask Your Question

Error: Config file has not been declared.

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

BhanuKiran.Chaluvadi gravatar image

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

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


@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 imagegvdhoorn ( 2017-07-22 01:56:35 -0600 )edit

1 Answer

Sort by » oldest newest most voted

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

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

Your Answer

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

Add Answer

Question Tools

1 follower


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

Seen: 361 times

Last updated: Jul 21 '17