I'm trying to compile a code with cmake and get this error (I'm pretty new with cmake):
/usr/bin/ld: cannot find -lMPC
Here is my CMakeLists.txt file:
cmake_minimum_required(VERSION 3.0.2)
project(PX4Vision_AutonomousLanding)
find_package(catkin REQUIRED COMPONENTS
roscpp
nav_msgs
geometry_msgs
mavros_msgs
)
include_directories(
${catkin_INCLUDE_DIRS}
)
catkin_package(
CATKIN_DEPENDS roscpp nav_msgs geometry_msgs mavros_msgs
)
add_executable(offboard_node
src/offboard_node.cpp
)
target_link_libraries(offboard_node
MPC
${CMAKE_DL_LIBS}
${catkin_LIBRARIES}
)
Inside the folder where my CMakeLists.txt file is I have a subfolder "src" where I have two files: "offboard_node.cpp" and "MPC.so". The first file contains the following line:
handle = dlopen("./MPC.so", RTLD_LAZY);