Page 1 of 2

在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-23 18:37
by kw_ddw
报错处为: /usr/bin/ld: cannot find -lgcc: No such file or directory

以下是报错信息
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
The C++ compiler

"/usr/bin/c++"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/pico/opencv/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_55af7/fast && /usr/bin/gmake -f CMakeFiles/cmTC_55af7.dir/build.make CMakeFiles/cmTC_55af7.dir/build
gmake[1]: Entering directory '/home/pico/opencv/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_55af7.dir/testCXXCompiler.cxx.o
/usr/bin/c++ -fPIE -o CMakeFiles/cmTC_55af7.dir/testCXXCompiler.cxx.o -c /home/pico/opencv/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_55af7
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_55af7.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTC_55af7.dir/testCXXCompiler.cxx.o -o cmTC_55af7
/usr/bin/ld: cannot find -lgcc: No such file or directory
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_55af7.dir/build.make:99: cmTC_55af7] Error 1
gmake[1]: Leaving directory '/home/pico/opencv/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_55af7/fast] Error 2





CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:120 (enable_language)

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-24 2:12
by Eng38
你好,

应用程序是无法在板子上直接进行编译的,需要在主机交叉编译后传输到开发板运行。
对于交叉编译,你需要使用 SDK 中提供的交叉编译工具。 你应该先在你的主机上部署 SDK 环境。

1. 在您的电脑上搭建SDK环境,请参考本教程:
https://wiki.luckfox.com/zh/Luckfox-Pico/Luckfox-Pico-SDK
2. 交叉编译参考:
https://wiki.luckfox.com/zh/Luckfox-Pico/Luckfox-Pico-opencv-mobile

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-24 7:34
by kw_ddw
您好,我在另一篇由传说之葱发布的有关交叉编译的帖子中了解到,如果在pico plus上使用sd卡烧录ubuntu镜像,是无法使用幸狐提供的交叉编译工具的,请问我理解的是否有错误?

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-24 7:43
by Eng38
是的,使用 ubuntu 系统请在连接网络后使用apt下载gcc与make,直接在板子上编译即可。

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-24 8:48
by kw_ddw
不好意思,我或许需要描述的更具体一些:上面的报错,缺少lgcc,是在sd卡烧录ubuntu镜像的情况下,我使用ssh传输opencv和contrib的源码,在板子上直接编译的情况下报的错。也就是说,opencv或许无法在pico plus烧录ubuntu镜像的情况下直接编译

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-24 20:58
by kw_ddw
您好,在进一步了解了论坛上的博客之后,我了解到使用ubuntu无法使用摄像头,我决定放弃ubuntu,请问百度云盘里的哪一个镜像能够契合我①使用摄像头②使用opencv③加载神经网络 的需求?感谢!
另:我已经学会使用交叉编译

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-25 3:09
by Eng38
建议使用buildroot构建的镜像,并尝试参考以下两个教程实现:

1. opencv-mobile:
https://wiki.luckfox.com/zh/Luckfox-Pic ... ncv-mobile
2. RKNN 模型推理测试:
https://wiki.luckfox.com/zh/Luckfox-Pic ... -RKNN-Test

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-26 17:26
by kw_ddw
您好:
我在运行
1. opencv-mobile:
https://wiki.luckfox.com/zh/Luckfox-Pic ... ncv-mobile
时遇到报错:
this device is not whitelisted for jpeg decoder cvi
this device is not whitelisted for jpeg decoder cvi
this device is not whitelisted for jpeg decoder cvi
this device is not whitelisted for capture cvi
this device is not whitelisted for capture cvi
this device is not whitelisted for capture cvi
this device is not whitelisted for capture cvi
this device is not whitelisted for capture cvi
this device is not whitelisted for capture cvi
this device is not whitelisted for capture cvi
devpath = /dev/video11
driver = rkisp_v7
card = rkisp_mainpath
bus_info = platform:rkisp-vir0
version = 20000
capabilities = 84201000
device_caps = 4201000
fmt = UYVY 4:2:2 59565955
fmt = Y/CbCr 4:2:2 3631564e
fmt = Y/CrCb 4:2:2 3136564e
fmt = Y/CrCb 4:2:0 3132564e
size = 32 x 16 ~ 2304 x 1296 (+8 +8)
fmt = Y/CbCr 4:2:0 3231564e
fmt = Y/CrCb 4:2:0 (N-C) 31324d4e
fmt = Y/CbCr 4:2:0 (N-C) 32314d4e
rkaiq log level ff0
/dev/video11 does not support changing fps
rga_api version 1.9.1_[0]
320 x 240
MessageParser process loop exit!
mpp[512]: mpp_buffer: mpi_buf_id = 136, dma_buf_fd = 5

mpp[512]: mpp: mClinetFd 7 open ok attr.chan_id 0

设备为pico_plus

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-26 17:28
by kw_ddw
补充,我的系统更换为buildroot,直接下载安装百度云盘里的镜像

Re: 在picoplus上编译opencv及opencv_contrib时遇到报错

Posted: 2024-01-27 3:08
by Eng38
这是在使用 pico plus 的 buildroot 镜像运行的结果,但无法复现你提到的错误
企业微信截图_17063241025366.png