Ask Your Question
0

No executable inside devel/lib/<package>

asked 2016-02-17 05:11:37 -0500

Vivian Liu gravatar image

updated 2016-02-17 09:23:05 -0500

Hi everyone, I am having a little problem building a node. After I created and built the package, I sourced the setup.bash file. Then I added "src/camera.cpp" to the package. The CMakeList is:

cmake_minimum_required(VERSION 2.8.3)
project(chapter5_tutorials)

find_package(catkin REQUIRED
    COMPONENTS
      roscpp
      message_generation
      sensor_msgs
      dynamic_reconfigure
      driver_base
      cv_bridge
      image_transport
      camera_info_manager
      tf)

find_package(OpenCV REQUIRED)

generate_dynamic_reconfigure_options(
    cfg/Camera.cfg
    cfg/CameraStereo.cfg
    cfg/Homography.cfg)

catkin_package(
    CATKIN_DEPENDS
      roscpp
      message_runtime
      sensor_msgs
      dynamic_reconfigure
      driver_base
      cv_bridge
      image_transport
      camera_info_manager
      tf)

include_directories(${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})

add_executable(camera src/camera.cpp)
add_dependencies(camera ${PROJECT_NAME}_gencfg)
target_link_libraries(camera ${catkin_LIBRARIES})

add_executable(camera_timer src/camera_timer.cpp)
target_link_libraries(camera_timer ${catkin_LIBRARIES})

add_executable(camera_polling src/camera_polling.cpp)
target_link_libraries(camera_polling ${catkin_LIBRARIES})

add_executable(camera_stereo src/camera_stereo.cpp)
add_dependencies(camera_stereo ${PROJECT_NAME}_gencfg)
target_link_libraries(camera_stereo ${catkin_LIBRARIES})

add_executable(homography src/homography.cpp)
add_dependencies(homography ${PROJECT_NAME}_gencfg)
target_link_libraries(homography ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})

install(TARGETS camera camera_timer camera_polling camera_stereo homography
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

foreach(dir bag config launch)
    install(DIRECTORY ${dir}/
        DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
endforeach(dir)

Then I use catkin_make again to build the package. The catkin_make output is:

Base path: /home/ally/dev/catkin_ws
Source space: /home/ally/dev/catkin_ws/src
Build space: /home/ally/dev/catkin_ws/build
Devel space: /home/ally/dev/catkin_ws/devel
Install space: /home/ally/dev/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ally/dev/catkin_ws/build"
####
####
#### Running command: "make -j1 -l1" in "/home/ally/dev/catkin_ws/build"
####

The catkin_make did not add targets to camera.cpp. I cannot find executable inside the devel/lib/<package> and therefore cannot run the node. Where could go wrong? Please help me out. Thank you:)

edit retag flag offensive close merge delete

Comments

3

Can you please post your complete CMakeLists.txt (but without all the comments)? Please edit it into your original question.

gvdhoorn gravatar image gvdhoorn  ( 2016-02-17 05:38:38 -0500 )edit

Also, please add the output of catkin_make.

mgruhler gravatar image mgruhler  ( 2016-02-17 05:40:58 -0500 )edit
1

The CMakeLists.txt appears to be ok. To avoid transients, can you try to rebuild your workspace after a rm -rf build && rm -rf devel in your catkin_ws/ dir?

gvdhoorn gravatar image gvdhoorn  ( 2016-02-17 09:22:54 -0500 )edit

Do any executables appear in devel/lib/? Can you show us your workspace layout and package structure?

gvdhoorn gravatar image gvdhoorn  ( 2016-02-17 09:39:03 -0500 )edit

After removing build and devel folder, the catkin_make output is:

make: *** Did not identify target and cannot find makefile. Aborted.
Invoking "make -j1 -l1" failed

cannot find makefile?

Vivian Liu gravatar image Vivian Liu  ( 2016-02-17 09:50:38 -0500 )edit

Please add your workspace layout to your question. I'm beginning to suspect you don't have the expected file & directory layout in your workspace and / or not invoking commands in the correct locations.

gvdhoorn gravatar image gvdhoorn  ( 2016-02-17 10:11:12 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-02-17 10:16:53 -0500

Vivian Liu gravatar image

Well, it turned out that I have a wrong makefile inside the package folder. After removing it and rebuild the package again, the targets can be built. Thanks for the replies!!!

edit flag offensive delete link more

Comments

Please answer your own question by ticking the checkmark next to this answer.

gvdhoorn gravatar image gvdhoorn  ( 2016-02-17 10:35:54 -0500 )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

1 follower

Stats

Asked: 2016-02-17 05:11:37 -0500

Seen: 757 times

Last updated: Feb 17 '16