自建飞行控制程序编译问题
已完成
自建的飞行控制程序在make过程中出现了无法定义的问题,报到错误是因为和libdjiosdk-core.a有关吗,但是在编译OSDK的过程中没有出现错误,各种库已经安装完毕,cmake的版本升级到了3.22
cmake_minimum_required(VERSION 3.10)
project(GalaxyZ_cpp)
set(CMAKE_CXX_STANDARD 17)
set(INC_DIR include/djiosdk/)
set(LINK_DIR library)
include_directories(${INC_DIR})
link_directories(${LINK_DIR})
link_libraries(djiosdk-core)
set(INC_DIR include)
set(LINK_DIR library)
include_directories(${INC_DIR})
link_directories(${LINK_DIR})
link_libraries(paho-mqtt3a)
link_libraries(paho-mqtt3as)
link_libraries(paho-mqttpp3)
add_executable(GalaxyZ_cpp main.cpp src/MQTT/MQTT_Publish.h src/MQTT/MQTT_Publish.cpp src/MQTT/MQTT_Subscribe.h src/MQTT/MQTT_Subscribe.cpp
src/Location/OtherLocation.h src/Config.h src/Config.cpp
src/N3/EnvironmentN3.cpp src/N3/EnvironmentN3.h src/Location/OtherLocation.cpp src/Location/MyLocation.cpp src/Location/Location.cpp src/Location/Location.h src/N3/FlightData.cpp src/N3/FlightData.h src/MQTT/MQTT_Time.cpp src/MQTT/MQTT_Time.h src/N3/FlightControl.cpp src/N3/FlightControl.h src/Controller/PID.cpp src/Controller/PID.h src/Controller/MoveController.cpp src/Controller/MoveController.h src/Status.cpp src/Status.h src/Task/TaskScheduler.cpp src/Task/TaskScheduler.h src/Base/PointGroup.cpp src/Base/PointGroup.h src/Strategy/LoadPointFile.cpp src/Strategy/LoadPointFile.h src/Task/Point2PointTask.cpp src/Task/Point2PointTask.h src/Task/Task.cpp src/Task/Task.h src/Base/Point.cpp src/Base/Point.h src/N3/CreatVehicle.cpp src/N3/CreatVehicle.h src/Base/File2Json.cpp src/Base/File2Json.h src/Command/Commands.cpp src/Command/Commands.h src/Command/KeyboardCmd.cpp src/Command/KeyboardCmd.h)
target_link_libraries(GalaxyZ_cpp paho-mqttpp3 paho-mqtt3as paho-mqtt3a djiosdk-core.a pthread)
下面是报的错误,我只截图了一部分,剩下的还有很多的无法定义。
ubuntu@ubuntu:~/Desktop/GalaxyZ_cpp/build$ sudo make
[sudo] password for ubuntu:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/Desktop/GalaxyZ_cpp/build
Consolidate compiler generated dependencies of target GalaxyZ_cpp
[ 4%] Linking CXX executable GalaxyZ_cpp
//usr/local/lib/libdjiosdk-core.a(dji_legacy_linker.cpp.o): In function `DJI::OSDK::LegacyLinker::legacyX5SEnableTask(void*)':
dji_legacy_linker.cpp:(.text+0x67): undefined reference to `DJI::OSDK::V1ProtocolCMD::Common::getVersion'
dji_legacy_linker.cpp:(.text+0x99): undefined reference to `DJI::OSDK::V1ProtocolCMD::Common::getVersion'
dji_legacy_linker.cpp:(.text+0xbb): undefined reference to `DJI::OSDK::Linker::getLocalSenderId()'
dji_legacy_linker.cpp:(.text+0xce): undefined reference to `OsdkOsal_TaskSleepMs'
dji_legacy_linker.cpp:(.text+0xd6): undefined reference to `DJI::OSDK::Linker::isUSBPlugged()'
dji_legacy_linker.cpp:(.text+0xe8): undefined reference to `DJI::OSDK::Linker::send(_cmdInfo*, unsigned char const*)'
//usr/local/lib/libdjiosdk-core.a(dji_legacy_linker.cpp.o): In function `DJI::OSDK::LegacyLinker::initX5SEnableThread()':
dji_legacy_linker.cpp:(.text+0x4f4): undefined reference to `OsdkOsal_TaskCreate'
//usr/local/lib/libdjiosdk-core.a(dji_legacy_linker.cpp.o): In function `DJI::OSDK::LegacyLinker::LegacyLinker(DJI::OSDK::Vehicle*)':
dji_legacy_linker.cpp:(.text+0xc3d): undefined reference to `OsdkOsal_TaskCreate'
//usr/local/lib/libdjiosdk-core.a(dji_legacy_linker.cpp.o): In function `DJI::OSDK::LegacyLinker::send(unsigned char const*, void*, unsigned long)':
dji_legacy_linker.cpp:(.text+0xd19): undefined reference to `DJI::OSDK::Linker::send(_cmdInfo*, unsigned char const*)'
//usr/local/lib/libdjiosdk-core.a(dji_legacy_linker.cpp.o): In function `DJI::OSDK::LegacyLinker::sendAsync(unsigned char const*, void*, unsigned long, int, int, void (*)(DJI::OSDK::Vehicle*, DJI::OSDK::RecvContainer, void*), void*)':
dji_legacy_linker.cpp:(.text+0xdf1): undefined reference to `DJI::OSDK::Linker::sendAsync(_cmdInfo*, unsigned char const*, void (*)(_cmdInfo const*, unsigned char const*, void*, E_OsdkStat), void*, unsigned int, unsigned short)'
//usr/local/lib/libdjiosdk-core.a(dji_legacy_linker.cpp.o): In function `DJI::OSDK::LegacyLinker::sendSync(unsigned char const*, void*, unsigned long, int, int)':
dji_legacy_linker.cpp:(.text+0xee5): undefined reference to `DJI::OSDK::Linker::sendSync(_cmdInfo*, unsigned char const*, _cmdInfo*, unsigned char*, unsigned int, unsigned short)'
//usr/local/lib/libdjiosdk-core.a(dji_legacy_linker.cpp.o): In function `DJI::OSDK::LegacyLinker::~LegacyLinker()':
dji_legacy_linker.cpp:(.text+0xca8): undefined reference to `OsdkOsal_TaskDestroy'
//usr/local/lib/libdjiosdk-core.a(dji_legacy_linker.cpp.o): In function `DJI::OSDK::LegacyLinker::registerCMDCallback(unsigned char, unsigned char, void (*&)(DJI::OSDK::Vehicle*, DJI::OSDK::RecvContainer, void*), void*&)':
dji_legacy_linker.cpp:(.text+0x1707): undefined reference to `DJI::OSDK::Linker::registerCmdHandler(T_RecvCmdHandle*)'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::sendHeartbeatToFCFunc(DJI::OSDK::Linker*) [clone .part.6]':
dji_vehicle.cpp:(.text+0x24e): undefined reference to `DJI::OSDK::Linker::sendSync(_cmdInfo*, unsigned char const*, _cmdInfo*, unsigned char*, unsigned int, unsigned short)'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::sendHeartbeatToFCTask(void*)':
dji_vehicle.cpp:(.text+0x30f): undefined reference to `OsdkOsal_TaskSleepMs'
dji_vehicle.cpp:(.text+0x36e): undefined reference to `OsdkOsal_TaskSleepMs'
dji_vehicle.cpp:(.text+0x376): undefined reference to `OsdkOsal_GetTimeMs'
dji_vehicle.cpp:(.text+0x391): undefined reference to `DJI::OSDK::Linker::isUartPlugged()'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::activateCallback(DJI::OSDK::Vehicle*, DJI::OSDK::RecvContainer, void*)':
dji_vehicle.cpp:(.text+0x4f0): undefined reference to `DJI::OSDK::Linker::setKey(char const*)'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::~Vehicle()':
dji_vehicle.cpp:(.text+0x136a): undefined reference to `OsdkOsal_TaskDestroy'
dji_vehicle.cpp:(.text+0x1665): undefined reference to `DJI::OSDK::AdvancedSensing::~AdvancedSensing()'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::initAdvancedSensing()':
dji_vehicle.cpp:(.text+0x3ca3): undefined reference to `DJI::OSDK::AdvancedSensing::AdvancedSensing(DJI::OSDK::Vehicle*)'
dji_vehicle.cpp:(.text+0x3cb2): undefined reference to `DJI::OSDK::AdvancedSensing::init()'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::processAdvancedSensingImgs(DJI::OSDK::RecvContainer*)':
dji_vehicle.cpp:(.text+0x3dc1): undefined reference to `DJI::OSDK::AdvancedSensing::unsubscribeStereoImages()'
dji_vehicle.cpp:(.text+0x3e1b): undefined reference to `DJI::OSDK::AdvancedSensing::unsubscribeVGAImages()'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::initOSDKHeartBeatThread()':
dji_vehicle.cpp:(.text+0x4030): undefined reference to `OsdkOsal_TaskCreate'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::init()':
dji_vehicle.cpp:(.text+0x43b1): undefined reference to `DJI::OSDK::Linker::isUSBPlugged()'
dji_vehicle.cpp:(.text+0x457f): undefined reference to `OsdkOsal_TaskCreate'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::setUSBFlightOn(bool)':
dji_vehicle.cpp:(.text+0x5713): undefined reference to `DJI::OSDK::Linker::isUSBPlugged()'
dji_vehicle.cpp:(.text+0x5744): undefined reference to `DJI::OSDK::V1ProtocolCMD::fc::usbFlightMode'
dji_vehicle.cpp:(.text+0x5772): undefined reference to `DJI::OSDK::V1ProtocolCMD::fc::usbFlightMode'
dji_vehicle.cpp:(.text+0x57ad): undefined reference to `DJI::OSDK::Linker::getLocalSenderId()'
dji_vehicle.cpp:(.text+0x584b): undefined reference to `DJI::OSDK::Linker::sendSync(_cmdInfo*, unsigned char const*, _cmdInfo*, unsigned char*, unsigned int, unsigned short)'
dji_vehicle.cpp:(.text+0x586b): undefined reference to `OsdkOsal_TaskSleepMs'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::setSimulationOn(bool, double, double)':
dji_vehicle.cpp:(.text+0x5a26): undefined reference to `DJI::OSDK::Linker::getLocalSenderId()'
dji_vehicle.cpp:(.text+0x5a54): undefined reference to `DJI::OSDK::Linker::sendSync(_cmdInfo*, unsigned char const*, _cmdInfo*, unsigned char*, unsigned int, unsigned short)'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::getDroneVersion(unsigned int)':
dji_vehicle.cpp:(.text+0x5df6): undefined reference to `DJI::OSDK::Linker::sendSync(_cmdInfo*, unsigned char const*, _cmdInfo*, unsigned char*, unsigned int, unsigned short)'
dji_vehicle.cpp:(.text+0x5f19): undefined reference to `DJI::OSDK::Linker::setSenderId(unsigned char)'
dji_vehicle.cpp:(.text+0x5fa6): undefined reference to `DJI::OSDK::Linker::setSenderId(unsigned char)'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::activate(DJI::OSDK::Vehicle::ActivateData*, unsigned int)':
dji_vehicle.cpp:(.text+0x65ae): undefined reference to `OsdkOsal_TaskSleepMs'
dji_vehicle.cpp:(.text+0x65c3): undefined reference to `DJI::OSDK::Linker::setKey(char const*)'
dji_vehicle.cpp:(.text+0x66e4): undefined reference to `DJI::OSDK::Linker::isUSBPlugged()'
dji_vehicle.cpp:(.text+0x6780): undefined reference to `OsdkOsal_TaskSleepMs'
dji_vehicle.cpp:(.text+0x67f4): undefined reference to `OsdkOsal_TaskSleepMs'
//usr/local/lib/libdjiosdk-core.a(dji_vehicle.cpp.o): In function `DJI::OSDK::Vehicle::activate(DJI::OSDK::Vehicle::ActivateData*, void (*)(DJI::OSDK::Vehicle*, DJI::OSDK::RecvContainer, void*), void*)':
dji_vehicle.cpp:(.text+0x6a4e): undefined reference to `OsdkOsal_TaskSleepMs'
dji_vehicle.cpp:(.text+0x6a84): undefined reference to `DJI::OSDK::Linker::isUSBPlugged()'
请先登录再写评论。
评论
1 条评论