gpt4 book ai didi

c++ - 在PC上编译一个c++程序与DJI phantom 4 pro通信

转载 作者:太空狗 更新时间:2023-10-29 12:40:15 24 4
gpt4 key购买 nike

我正在尝试在我的 PC(linux mint)上接收来自 DJI phantom 4 使用 OpenCV 的摄像头的流。我下面的例子是:https://developer.dji.com/guidance-sdk/documentation/tutorials/index.html (我正在关注 linux 部分)我在/usr/local/lib 中复制了 Copy libDJI_guidance.so 并检查了一下,它就在那里。生成文件是:

#define a compiler
CXX = g++
#define target name
TARGET = main
#define dependencies of target
OBJECTS = main.o DJI_utility.o
#define the Include and Library path
CFLAGS = -g -Wall -I/usr/local/include -I../../../include
LDFLAGS = -Wl,-rpath,./ -lpthread -lrt -L./ -L/usr/local/lib/ -lDJI_guidance -lusb-1.0 `pkg-config --cflags --libs opencv`

$(TARGET) : $(OBJECTS)
$(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS)
main.o : main.cpp DJI_utility.h
$(CXX) $(CFLAGS) -c main.cpp DJI_utility.h
DJI_utility.o : DJI_utility.cpp DJI_utility.h
$(CXX) $(CFLAGS) -c DJI_utility.cpp DJI_utility.h
clean:
rm -rf *.o *.gch *.avi $(TARGET)

但是当我在命令行中执行 make 时,我得到:

g++ -o main main.o DJI_utility.o -Wl,-rpath,./ -lpthread -lrt -L./ -L/usr/local/lib/ -lDJI_guidance -lusb-1.0 `pkg-config --cflags --libs opencv` 
/usr/bin/ld: skipping incompatible /usr/local/lib//libDJI_guidance.so when searching for -lDJI_guidance
/usr/bin/ld: skipping incompatible /usr/local/lib/libDJI_guidance.so when searching for -lDJI_guidance
/usr/bin/ld: skipping incompatible //usr/local/lib/libDJI_guidance.so when searching for -lDJI_guidance
/usr/bin/ld: cannot find -lDJI_guidance
/usr/bin/ld: cannot find -lusb-1.0
collect2: error: ld returned 1 exit status
Makefile:12: recipe for target 'main' failed
make: *** [main] Error 1

项目位于:

 ~/Documents/studies_SRT/SRT5/TX_drone/Guidance-SDK/demo/guidance_track

ls 的输出是:DJI_guidance.h DJI_utility.cpp DJI_utility.h DJI_utility.h.gch DJI_utility.o main.cpp main.o Makefile

谢谢。

最佳答案

您似乎下载了错误架构的库文件。如果您使用的是 64 位系统,请下载 64 位版本的库。

关于c++ - 在PC上编译一个c++程序与DJI phantom 4 pro通信,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47676961/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com