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

CMake Error: The following variables are used in this project but they are set to NOTFOUND.

asked 2019-05-10 04:23:35 -0500

Tayssir Boubaker gravatar image

updated 2019-05-11 05:36:24 -0500

Hello everyone,

Actually, I am working on Ubuntu 14 and Indigo Version, so am trying to make some packages. I got an error message below :

-- Using these message generators: gencpp;genlisp;genpy
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Modbus_LIBRARIES
   linked by target "<package_name>" in directory /home/tayssir/catkin_ws/src/robot_ws_debug/src/package_name

-- Configuring incomplete, errors occurred!
See also "/home/tayssir/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/tayssir/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

I tried to use ROS_LANG_DISABLE like is mentioned in ROS EnvironmentVariables :

$export ROS_LANG_DISABLE=genlisp

but this can not solve the problem.

How would I fix it? Thanks.


Edit: Thanks for your help @gvdhoorn, and I'm going through the tutorial modbus to install it, and there is my CMAKE File below :

find_path(Modbus_INCLUDE_DIR modbus/modbus.h
   HINTS
   /usr/include/modbus
   /usr/local/include
   )

find_library(Modbus_LIBRARIES NAMES modbus
   HINTS
   /usr/lib/x86_64-linux-gnu
   /usr/local/lib
   )

include_directories(
   ${catkin_INCLUDE_DIRS}
   ${Modbus_INCLUDE_DIR}/modbus
   )

It seems that my environment is set correctly! But I don’t know where is the problem and how can I resolve it??!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-05-10 08:38:33 -0500

gvdhoorn gravatar image

updated 2019-05-11 04:11:36 -0500

From the error message, I don't believe this has anything to do with ROS_LANG_DISABLE.

Please set them or make sure they are set and tested correctly in the CMake files: Modbus_LIBRARIES

it would appear that some package in your workspace needs Modbus functionality and the CMakeLists.txt is probably using something like find_package(..) or find_library(..) and fails. Those then set Modbus_LIBRARIES to NOTFOUND, leading to CMake printing the error that you show.

You'll have to check what uses Modbus in your workspace and resolve any problem it has finding the required libraries.


Edit:

I'm going through the tutorial modbus to install it

Judging from the CMakeLists.txt you show, I doubt the modbus package you link to is the one that your package is looking for, for two reasons:

  1. that package is a Python package (so does not provide any C++ libraries)
  2. your CMakeLists.txt uses find_library(..) and find_path(..), instead of find_package(..)

You'll have to figure out which particular library/package/project your package requires, otherwise this will be difficult to fix.

Is there any information in a readme perhaps, or some other form of documentation? Does the package.xml of your package tell you anything?

but I'm an absolute beginner with ROS

please note: this is not actually a ROS problem (any more), but a general "how do I make sure all dependencies of my software are installed" and CMake problem. When looking for help, you don't need to limit yourself to ROS fora.

edit flag offensive delete link more

Comments

thanks for your help , but the project that am working on ,have not any documentation so the only thing that i should find a solution with my CMAKE files

Tayssir Boubaker gravatar image Tayssir Boubaker  ( 2019-05-11 06:06:13 -0500 )edit

Then you will have to figure out which particular version of or library modbus actually is.

Does the package.xml give any clues?

A quick google suggests it could perhaps be stephane/libmodbus. But that is just a guess.

gvdhoorn gravatar image gvdhoorn  ( 2019-05-11 07:55:45 -0500 )edit

thank you very much, your suggestions helped me to solve the problem .. when am looking for the modbus version .. I discover that the library was not installed and can not find any commands !! So a simple update and install .. solve the problem :

sudo apt-get update
sudo apt-get install libmodbus-dev
Tayssir Boubaker gravatar image Tayssir Boubaker  ( 2019-05-11 10:29:17 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-05-10 04:23:35 -0500

Seen: 35,718 times

Last updated: May 11 '19