'no rule to make target' error while building catkin package (ROS)

Viewed 1845

I am trying to use lua in a ros package named gazebo_test but not able to link lua library to package. While building package with catkin_make 'no rule to make target error' is occurring. I have searched for it, but nothing helped. As given in most answers I have checked for file in the path its there but still not able to build.

Following is my CMakeLists.txt file:

cmake_minimum_required(VERSION 2.8.3)
project(gazebo_test)
add_compile_options(-std=c++11)

set(LUA_INCLUDE_DIR /usr/include/lua5.2)
set(LUA_LIBRARY /usr/lib/x86_64-linux-gnu/liblua5.2.so)

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs gazebo_ros gazebo_msgs tf sensor_msgs image_transport cv_bridge)

find_package(gazebo REQUIRED)

catkin_package(DEPENDS roscpp gazebo_ros)

include_directories(${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ${GAZEBO_INCLUDE_DIRS} ${LUA_INCLUDE_DIR})

link_directories(${GAZEBO_LIBRARY_DIRS})
add_executable(deepQ_test_script src/deepQ_test_script.cpp)

target_link_libraries (deepQ_test_script ${LUA_LIBRARY})

Following ERROR is occuring:

make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/liblua5.2.so', needed by '/home/sudhir/ros_ws/devel/lib/gazebo_test/deepQ_test_script'.

I have attempted following things already

  • Checked properly that path of liblua5.2.so is correct and file is present there.
  • I have tried to copy header files and .so files to package's include and libs directory and then updated paths in CMakeLists.txt using ${PROJECT_SOURCE_DIR} but still same error.
  • Added path of .so file to PKG_CONFIG_PATH variable and following were outputs of pkg-config commands
  • pkg-config --libs lua5.2 -----> -llua5.2
  • pkg-config --cflags lua5.2 ----> -I/usr/include/lua5.2

Still error is same.

Please Help. Thanks in advance.

0 Answers
Related