cakin_make returns the error '/usr/bin/ld: cannot find -lRTIMULib'
I'm attempting to catkin_make the imu package from this link But I'm getting the error:
/usr/bin/ld: cannot find -lRTIMULib
From as far as I can tell the library is include and linked in the CMake.txt
Does the location of the library file matter? It's currently in ~/catkin_ws/src/i2c_imu-master/src
Thanks for any help, the CMake.txt is as follows:
cmake_minimum_required(VERSION 2.8.3)
project(i2c_imu)
find_package(catkin REQUIRED COMPONENTS
sensor_msgs
roscpp
tf
angles
)
find_library(RTIMULib libRTIMULib.so)
message(STATUS "RTIMULib: ${RTIMULib }")
catkin_package(
CATKIN_DEPENDS sensor_msgs roscpp tf angles
)
include_directories(
${catkin_INCLUDE_DIRS}
)
add_executable(i2c_imu_node src/i2c_imu_node.cpp)
target_link_libraries(i2c_imu_node
RTIMULib
${catkin_LIBRARIES}
)
EDIT:
The output of catkin_make after adding message(STATUS "RTIMULib: ${RTIMULib }")
after find_library(RTIMULib ..):
in the CMakeList.txt.
Base path: /home/nvidia/catkin_ws
Source space: /home/nvidia/catkin_ws/src
Build space: /home/nvidia/catkin_ws/build
Devel space: /home/nvidia/catkin_ws/devel
Install space: /home/nvidia/catkin_ws/install
####
#### Running command: "cmake /home/nvidia/catkin_ws/src -
DCATKIN_DEVEL_PREFIX=/home/nvidia/catkin_ws/devel -
DCMAKE_INSTALL_PREFIX=/home/nvidia/catkin_ws/install -G Unix Makefiles" in "/home/nvidia/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/nvidia/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/nvidia/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/nvidia/catkin_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/nvidia/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.8
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - i2c_imu
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'i2c_imu'
-- ==> add_subdirectory(i2c_imu-master)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at i2c_imu-master/CMakeLists.txt:19 (message):
Syntax error in cmake code at
/home/nvidia/catkin_ws/src/i2c_imu-master/CMakeLists.txt:19
when parsing string
RTIMULib: ${{RTIMULib }}
syntax error, unexpected cal_SYMBOL, expecting }} (22)
-- Configuring incomplete, errors occurred!
See also "/home/nvidia/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/nvidia/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
Can you add the following line to the
CMakeLists.txt
and add whatever gets printed to your OP? Add this afterfind_library(RTIMULib ..)
:Thanks for your reply! The question has been updated with the information you asked for
You have a space in there after the variable name. CMake might not like that.
And as @ahendrix writes: you probably need to install the library. The
message(STATUS ..)
was just to see whether the library is actually found or not.