2

在 ubuntu 16.04 终端中执行 make 命令时出现以下错误。

请告诉我,我该如何解决?

(cv) mallikarjun@mallikarjun-ideapad-z570:~/opencv-3.1.0/build$ make
[  0%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.o
In file included from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:7:0,
                 from /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:34,
                 from /home/mallikarjun/opencv-3.1.0/build/3rdparty/zlib/zconf.h:397,
                 from /home/mallikarjun/opencv-3.1.0/3rdparty/zlib/zlib.h:34,
                 from /home/mallikarjun/opencv-3.1.0/3rdparty/zlib/zutil.h:22,
                 from /home/mallikarjun/opencv-3.1.0/3rdparty/zlib/adler32.c:8:
/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
compilation terminated.
3rdparty/zlib/CMakeFiles/zlib.dir/build.make:62: recipe for target '3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.o' failed
make[2]: *** [3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.o] Error 1
CMakeFiles/Makefile2:302: recipe for target '3rdparty/zlib/CMakeFiles/zlib.dir/all' failed
make[1]: *** [3rdparty/zlib/CMakeFiles/zlib.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
4

1 回答 1

1

可能你安装了错误的 gcc 版本。您可以尝试安装两个 GCC 版本。这在此处和本白皮书中进行了描述

于 2019-08-07T15:27:43.837 回答