Attempting to build example 4.1 fails

when trying to use example 4.1 I get this error,

user:~/catkin_ws$ catkin build
-------------------------------------------------------------------------------
Profile:                     default
Extending:          [cached] /home/simulations/public_sim_ws/devel:/opt/ros/noetic
Workspace:                   /home/user/catkin_ws
-------------------------------------------------------------------------------
Build Space:        [exists] /home/user/catkin_ws/build
Devel Space:        [exists] /home/user/catkin_ws/devel
Install Space:      [unused] /home/user/catkin_ws/install
Log Space:          [exists] /home/user/catkin_ws/logs
Source Space:       [exists] /home/user/catkin_ws/src
DESTDIR:            [unused] None
-------------------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
-------------------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
-------------------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
-------------------------------------------------------------------------------
Workspace configuration appears valid.
-------------------------------------------------------------------------------
[build] Found '1' packages in 0.0 seconds.
[build] Package table is up to date.
Starting  >>> my_examples
______________________________________________________________________________
Errors     << my_examples:cmake /home/user/catkin_ws/logs/my_examples/build.cmake.003.log
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "pkg" with any of
  the following names:

    pkgConfig.cmake
    pkg-config.cmake

  Add the installation prefix of "pkg" to CMAKE_PREFIX_PATH or set "pkg_DIR"
  to a directory containing one of the above files.  If "pkg" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:10 (find_package)


cd /home/user/catkin_ws/build/my_examples; catkin build --get-env my_examples | catkin env -si  /usr/bin/cmake /home/user/catkin_ws/src/my_examples_pkg --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/user/catkin_ws/devel/.private/my_examples -DCMAKE_INSTALL_PREFIX=/home/user/catkin_ws/install; cd -
..............................................................................
Failed     << my_examples:cmake          [ Exited with code 1 ]
Failed    <<< my_examples                [ 3.4 seconds ]
[build] Summary: 0 of 1 packages succeeded.
[build]   Ignored:   None.
[build]   Warnings:  None.
[build]   Abandoned: None.
[build]   Failed:    1 packages failed.
[build] Runtime: 3.5 seconds total.

I have so far tried:
to use catkin clean
to restart the simulation
to use catkin_make instead of build

any ideas?
I would appreciate any assistance,

Looks like you CMakeLists.txt file was not properly modified. Please go over the instructions and edit it properly.

Do you have a package named ā€œpkgā€ as indicated on line 10 of that file?

solved the problem by remaking the package from scratch, because all other attempts have failed, but it seems that either there was a problem while creating the package or that my dependencies were incorrect(unlikely i copied them straight from the example), anyway now it works

1 Like

This topic was automatically closed after 12 hours. New replies are no longer allowed.