Hello,

I am running into this issue where I create a new package, add a cpp source code, create a launch file and change the CMakeLists.txt but I end up with the following error:

roscd
cd ..
catkin_make --pkg service_client_pkg
Base path: /home/user/catkin_ws
Source space: /home/user/catkin_ws/src
Build space: /home/user/catkin_ws/build
Devel space: /home/user/catkin_ws/devel
Install space: /home/user/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/user/catkin_ws/build"
####
####
#### Running command: "make -j2 -l2" in "/home/user/catkin_ws/build/service_client_pkg"
####
Failed command '['make', '-j2', '-l2']': [Errno 2] No such file or directory: '/home/user/catkin_ws/build/service_client_pkg'

What am I doing wrong? Scratching my head on this. I compared my CMakeLists.txt with the previous packages and they look correct to me and follow the pattern.. Here is the content for CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(service_client_pkg)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
add_executable(simple_service_client src/simple_service_client.cpp)

## Add cmake target dependencies of the executable
## same as for the library above
add_dependencies(simple_service_client ${simple_service_client_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
target_link_libraries(simple_service_client
  ${catkin_LIBRARIES}
)

Here is the screenshot of my folder structure:

alt text

rospack list finds my package:

rospack list | grep service_client_pkg
service_client_pkg /home/user/catkin_ws/src/service_client_pkg

asked 02 Jul, 02:57

swarooph.nirmal%40gmail.com's gravatar image

swarooph.nir...
01
accept rate: 0%

edited 02 Jul, 02:58


Hi @swaroophnirmalgmailcom,

From the error message, the program is trying to look for the built version of the package in catkin_ws/build/ when the package has not been built. Something is wrong somewhere. And your CMakeLists.txt appears to be correct as well...

Can you try removing the build folder and building all packages again?

user:~/catkin_ws$ rm -rf build/ user:~/catkin_ws$ catkin_make

permanent link

answered 02 Jul, 11:44

bayodesegun%40bayodesegun.com's gravatar image

bayodesegun@...
1352
accept rate: 37%

It seems like once I had to reconnect to the environment, everything just worked without any changes.. Weird. Are there any best practices for how to reset the online ROSDS environment fully? Browser refresh (F5) does not seem to do the trick alone.

(04 Jul, 01:26) swarooph.nir...

One of the best practices is removing the build folder as highlighted above. When you reconnect to the environment, your build folder is regenerated, as we don't save it with your project.

(04 Jul, 09:11) bayodesegun@...
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×15
×1

question asked: 02 Jul, 02:57

question was seen: 57 times

last updated: 04 Jul, 09:11

powered by OSQA