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

Revision history [back]

click to hide/show revision 1
initial version

Hey dornhege, here are your answers: 1) This is the output when I say make

mkdir -p bin cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=rospack find rosbuild/rostoolchain.cmake .. [rosbuild] Building package robot_node [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/roslisp/cmake/roslisp.cmake [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/rospy/cmake/rospy.cmake [rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project:

CMAKE_TOOLCHAIN_FILE

-- Build files have been written to: /home/nishantabb/ros_workspace/ROS/robot_node/build cd build && make make[1]: Entering directory /home/nishantabb/ros_workspace/ROS/robot_node/build' make[2]: Entering directory/home/nishantabb/ros_workspace/ROS/robot_node/build' make[3]: Entering directory /home/nishantabb/ros_workspace/ROS/robot_node/build' make[3]: Leaving directory/home/nishantabb/ros_workspace/ROS/robot_node/build' make[3]: Entering directory /home/nishantabb/ros_workspace/ROS/robot_node/build' make[3]: * No rule to make target../../../ABBInterpreter/lib/libABBInterpreter.a', needed by libABBInterpreter.a'. Stop. make[3]: Leaving directory/home/nishantabb/ros_workspace/ROS/robot_node/build' make[2]: * [CMakeFiles/makeABBLIB.dir/all] Error 2 make[2]: Leaving directory /home/nishantabb/ros_workspace/ROS/robot_node/build' make[1]: * [all] Error 2 make[1]: Leaving directory/home/nishantabb/ros_workspace/ROS/robot_node/build' make: * [all] Error 2

2) This is the CMakeLists.txt

cmake_minimum_required(VERSION 2.4.6) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

rosbuild_init()

set the default path for built executables to the "bin" directory

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

set the default path for built libraries to the "lib" directory

set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

set(ABB_PATH ${PROJECT_SOURCE_DIR}/../../ABBInterpreter)

ADD_CUSTOM_COMMAND( OUTPUT libABBInterpreter.a COMMAND make -C ${ABB_PATH} DEPENDS ${ABB_PATH}/lib/libABBInterpreter.a )

ADD_CUSTOM_TARGET(makeABBLIB ALL DEPENDS libABBInterpreter.a)

common commands for building c++ executables and libraries

rosbuild_add_library(${PROJECT_NAME} src/example.cpp)

target_link_libraries(${PROJECT_NAME} another_library)

rosbuild_add_boost_directories()

rosbuild_link_boost(${PROJECT_NAME} thread)

rosbuild_add_executable(example examples/example.cpp)

target_link_libraries(example ${PROJECT_NAME})

include_directories(${ABB_PATH}/include) link_directories(${ABB_PATH}/lib)

rosbuild_add_executable(robot_node src/robot_node.cpp) target_link_libraries(robot_node -lABBInterpreter)

3) I checked the bin/ folder of the robot_node package. There seems to be nothing in it.

Question: How can I comment on your answer on this forum? It would be much easier than just creating a new answer altogether. Thanks!

Hey dornhege, here are your answers: 1) This is the output when I say make

mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=rospack -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild/rostoolchain.cmake rosbuild`/rostoolchain.cmake  ..
[rosbuild] Building package robot_node
[rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/roslisp/cmake/roslisp.cmake
[rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/rospy/cmake/rospy.cmake
[rosbuild] Including /opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
-- Configuring done
-- Generating done
CMake Warning:
 Manually-specified variables were not used by the project:

CMAKE_TOOLCHAIN_FILE

project: CMAKE_TOOLCHAIN_FILE -- Build files have been written to: /home/nishantabb/ros_workspace/ROS/robot_node/build cd build && make make[1]: Entering directory /home/nishantabb/ros_workspace/ROS/robot_node/build' `/home/nishantabb/ros_workspace/ROS/robot_node/build' make[2]: Entering directory/home/nishantabb/ros_workspace/ROS/robot_node/build' directory `/home/nishantabb/ros_workspace/ROS/robot_node/build' make[3]: Entering directory /home/nishantabb/ros_workspace/ROS/robot_node/build' `/home/nishantabb/ros_workspace/ROS/robot_node/build' make[3]: Leaving directory/home/nishantabb/ros_workspace/ROS/robot_node/build' directory `/home/nishantabb/ros_workspace/ROS/robot_node/build' make[3]: Entering directory /home/nishantabb/ros_workspace/ROS/robot_node/build' `/home/nishantabb/ros_workspace/ROS/robot_node/build' make[3]: * No rule to make target../../../ABBInterpreter/lib/libABBInterpreter.a', target `../../../ABBInterpreter/lib/libABBInterpreter.a', needed by libABBInterpreter.a'. `libABBInterpreter.a'. Stop. make[3]: Leaving directory/home/nishantabb/ros_workspace/ROS/robot_node/build' directory `/home/nishantabb/ros_workspace/ROS/robot_node/build' make[2]: * [CMakeFiles/makeABBLIB.dir/all] Error 2 make[2]: Leaving directory /home/nishantabb/ros_workspace/ROS/robot_node/build' `/home/nishantabb/ros_workspace/ROS/robot_node/build' make[1]: * [all] Error 2 make[1]: Leaving directory/home/nishantabb/ros_workspace/ROS/robot_node/build' directory `/home/nishantabb/ros_workspace/ROS/robot_node/build' make: * [all] Error 2

2

2) This is the CMakeLists.txt

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

rosbuild_init()

set include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) rosbuild_init() #set the default path for built executables to the "bin" directory

directory set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

set ${PROJECT_SOURCE_DIR}/bin) #set the default path for built libraries to the "lib" directory

directory set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

${PROJECT_SOURCE_DIR}/lib) set(ABB_PATH ${PROJECT_SOURCE_DIR}/../../ABBInterpreter)

${PROJECT_SOURCE_DIR}/../../ABBInterpreter) ADD_CUSTOM_COMMAND( OUTPUT libABBInterpreter.a COMMAND make -C ${ABB_PATH} DEPENDS ${ABB_PATH}/lib/libABBInterpreter.a )

) ADD_CUSTOM_TARGET(makeABBLIB ALL DEPENDS libABBInterpreter.a)

common libABBInterpreter.a) #common commands for building c++ executables and libraries

rosbuild_add_library(${PROJECT_NAME} src/example.cpp)

target_link_libraries(${PROJECT_NAME} another_library)

rosbuild_add_boost_directories()

rosbuild_link_boost(${PROJECT_NAME} thread)

rosbuild_add_executable(example examples/example.cpp)

target_link_libraries(example ${PROJECT_NAME})

libraries #rosbuild_add_library(${PROJECT_NAME} src/example.cpp) #target_link_libraries(${PROJECT_NAME} another_library) #rosbuild_add_boost_directories() #rosbuild_link_boost(${PROJECT_NAME} thread) #rosbuild_add_executable(example examples/example.cpp) #target_link_libraries(example ${PROJECT_NAME}) include_directories(${ABB_PATH}/include) link_directories(${ABB_PATH}/lib)

link_directories(${ABB_PATH}/lib) rosbuild_add_executable(robot_node src/robot_node.cpp) target_link_libraries(robot_node -lABBInterpreter)

-lABBInterpreter)

3) I checked the bin/ folder of the robot_node package. There seems to be nothing in it.

Question: How can I comment on your answer on this forum? It would be much easier than just creating a new answer altogether. Thanks!