# Can't include an installed library

Hey, i started working with px4_msgs, i cloned and compiled the package properly but unfortunately i can't use the package when working on my own code with Clion: When i try to include the package It correctly link between the name and the external libraries, but can't actually include it in the code with the error that file not found.

Here is my CmakeLists file, If Someone faced this kind of issue and can help it will be awesome!!

cmake_minimum_required(VERSION 3.5)
project(drone)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(px4_msgs REQUIRED)

ament_target_dependencies(${PROJECT_NAME} "rclcpp" "rclcpp_action" "std_msgs" "sensor_msgs" "nav_msgs" "px4_msgs" ) install(TARGETS${PROJECT_NAME}
DESTINATION
lib/${PROJECT_NAME} ) ament_package()  edit retag close merge delete ## 2 Answers Sort by » oldest newest most voted What you are probably running into is that you are using ament_target_dependencies for a target that matches your project_name (from${PROJECT_NAME}). However, you do not build a library or add an executable to assign those dependencies to.

Later, you also try to install a target with the same \${PROJECT_NAME}, and since there is no target CMake will most likely complain about that.

If you are not building any code, I would not install anything. However, you can still set dependencies for your package, just use the ament_export_dependencies call instead.

more

You are talking about the package px4_msgs right? Did you also add it to your package.xml? If you check your package.xml file there should be a line somewhere that states:

<depend>px4_msgs</depend>

Something else you could try. You said you cloned and build the px4_msgs package yourself right? Did you make sure to source the workspace in which you build that package?

more