You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following basic CMakeLists.txt for my C++ code that makes use of the Telemetry API.
CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(telemetry-stream)
# Set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Enable strict handling of warnings
add_definitions("-Wall -Wextra -Werror")
# Find MAVSDK package
find_package(MAVSDK REQUIRED)
# Add executable target with source files
add_executable(telemetry-stream main.cpp)
# Link MAVSDK library
target_link_libraries(telemetry-stream
MAVSDK::mavsdk
)
Output
-- Configuring done (0.1s) CMake Error at CMakeLists.txt:18 (target_link_libraries): Target "telemetry-stream" links to:
MAVSDK::mavsdk_telemetry
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
-- Generating done (0.0s)
CMake Generate step failed. Build files cannot be regenerated correctly.
According to this documentation, MAVSDK::mavsdk_telemetry is needed within the target_link_libraries call.
However, this following example's source code which makes use of Telemetry does NOT include MAVSDK::mavsdk_telemetry within the target_link_libraries call.
If I delete MAVSDK::mavsdk_telemetry, I am able to build and execute.
However, I wanted to ask: why there is a discrepancy between the documentation and the example, and which I should follow?
The text was updated successfully, but these errors were encountered:
I have the following basic
CMakeLists.txt
for my C++ code that makes use of the Telemetry API.CMakeLists.txt
Output
According to this documentation,
MAVSDK::mavsdk_telemetry
is needed within thetarget_link_libraries
call.However, this following example's source code which makes use of Telemetry does NOT include
MAVSDK::mavsdk_telemetry
within thetarget_link_libraries
call.If I delete
MAVSDK::mavsdk_telemetry
, I am able to build and execute.However, I wanted to ask: why there is a discrepancy between the documentation and the example, and which I should follow?
The text was updated successfully, but these errors were encountered: