【发布时间】:2020-08-03 18:58:44
【问题描述】:
我有带有 Raspbian 的 Raspberry Pi 4(更新到最新版本)并尝试获取 Opencv。我有 Python 2.7、所有依赖项等。我在虚拟环境中工作,但在非虚拟版本上安装了另一个版本,我得到了同样的错误。
(cv) pi@raspberrypi:~ $ cd ~/opencv-3.1.0/build
(cv) pi@raspberrypi:~/opencv-3.1.0/build $ make
[ 2%] Built target libwebp
[ 4%] Built target libjasper
[ 7%] Built target IlmImf
[ 7%] Built target opencv_highgui_pch_dephelp
[ 7%] Built target pch_Generate_opencv_highgui
[ 8%] Built target opencv_core_pch_dephelp
[ 8%] Generating precomp.hpp.gch/opencv_core_RELEASE.gch
In file included from
/usr/include/c++/8/bits/stl_algo.h:59,
from /usr/include/c++/8/algorithm:62,
from /home/pi/opencv-3.1.0/modules/core/include/opencv2/core/base.hpp:53,
from /home/pi/opencv-3.1.0/modules/core/include/opencv2/core.hpp:54,
from /home/pi/opencv-3.1.0/modules/core/include/opencv2/core/utility.hpp:52,
from /home/pi/opencv-3.1.0/build/modules/core/precomp.hpp:49:
/usr/include/c++/8/cstdlib:75:15: fatal error: stdlib.h:
No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/build.make:64: modules/core/precomp.hpp.gch/opencv_core_RELEASE.gch]
Error 1
make[1]: *** [CMakeFiles/Makefile2:2336: modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all]
Error 2
make: *** [Makefile:163: all] Error 2
cv 是我的虚拟环境。错误发生在 pi 附带的默认 C++ 目录中的文件中。 c++标准库在同一个文件夹中找不到C标准库。我已经检查过它们都在那里并且都未经编辑。我想知道 gnu 编译器如何只能访问 C++ 目录的一部分。
【问题讨论】:
标签: python opencv gcc raspberry-pi