错误显示一个三个库没找到
1、<linux/videodev.h> not found
fatal error: linux/videodev.h: 没有那个文件或目录
#include <linux/videodev.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
解决方法:
安装libv4l-dev库
sudo apt-get install libv4l-dev
建立软映射连接
sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h
2、<sys/videoio.h> not found
fatal error: sys/videoio.h: 没有那个文件或目录
#include <sys/videoio.h>
^~~~~~~~~~~~~~~
compilation terminated.
这个不用管,不影响使用,参考:
sys/videoio.h not found_zhe_csdn的博客-CSDN博客
编程遇到问题与解决(opencv 、sys / videoio.h 、eigen)_flygqin的博客-CSDN博客
OpenCV-3编译安装方法及常见错误解决(Ubuntu平台)_AskuaSen-CSDN博客
解决方法:
让系统找到videoio.h即可
sudo mkdir /usr/include/sys/ #新建文件夹
sudo cp /usr/local/include/opencv2/videoio/videoio_c.h /usr/include/sys/
sudo ln -s /usr/include/sys/videoio_c.h /usr/include/sys/videoio.h
2.5、 <sys/sysctl.h> not found
错误提示:opencv-2.4.13/modules/core/src/parallel.cpp:60:18: fatal error: sys/sysctl.h: No such file or directory
#include <sys/sysctl.h>
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/build.make:370: modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.o] Error 1
错误原因:新版本Linux 系统删除了sys/sysctl.h。
解决方法:
注释掉文件opencv-2.4.13/modules/core/src/parallel.cpp中的 #include <sys/sysctl.h>
注视掉文件opencv-2.4.13/modules/core/src/system.cpp中的 #include <sys/sysctl.h>
3、<ffmpeg/avformat.h> not found
fatal error: ffmpeg/avformat.h: 没有那个文件或目录
#include <ffmpeg/avformat.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
这个错误是因为缺乏ffmpeg的库
解决方法:
安装ffmpeg
sudo apt install ffmpeg
建立文件夹,和软连接
sudo mkdir /usr/include/ffmpeg
sudo ln -s /usr/include/x86_64-linux-gnu/libavformat/avformat.h /usr/include/ffmpeg/avformat.h
sudo ln -s /usr/include/x86_64-linux-gnu/libavformat/avio.h /usr/include/ffmpeg/avio.h
4、CUDA问题
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
opencv_dep_CUDA_nppi_LIBRARY
linked by target "opencv_test_core" in directory /home/ubuntu/Mydata/opencv-2.4.11/modules/core
linked by target "opencv_test_core" in directory /home/ubuntu/Mydata/opencv-2.4.11/modules/core
linked by target "opencv_core" in directory /home/ubuntu/Mydata/opencv-2.4.11/modules/core
linked by target "opencv_core" in directory /home/ubuntu/Mydata/opencv-2.4.11/modules/core
linked by target "opencv_perf_core" in directory /home/ubuntu/Mydata/opencv-2.4.11/modules/core
.......
解决方法:
Window CMAKE 编译opencv3.4.1(CUDA9.1)遇到错误 linked by target "opencv_cudev" in directory_cvml的博客-CSDN博客
5、Ubuntu 18.4不支持opencv-2.4.11自带的OpenCVDetectCXXCompiler.cmake
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:85 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:89 (include)
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:86 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:89 (include)
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:89 (math):
math cannot parse the expression: "*100 + ": syntax error, unexpected
exp_TIMES, expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER
(1)
Call Stack (most recent call first):
CMakeLists.txt:89 (include)
解决方法:
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:85 (list)_u010003609的博客-CSDN博客
6、make出错
/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: 没有那个文件或目录
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
cmake时加上参数-D ENABLE_PRECOMPILED_HEADERS=OFF
7、NVCC出错
nvcc fatal : Unsupported gpu architecture 'compute_20'
CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:208 (message):
Error generating
/home/ubuntu/Mydata/opencv-2.4.11/build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o
解决方法:
cmake时加上参数-D CUDA_GENERATION=Kepler
CMake
Files/
opencv
_example
.
dir/example
.
cpp
.
o:在函数‘main’中:
example
.
cpp:(
.
text+0x1
2
c):对‘cv::imshow(cv::String const&, cv::_InputArray const&)’未定义的引用
example
.
cpp:(
.
text+0x
2
1d):对‘cv::imshow(cv::String
ubuntu
2
0
.
04
安装
opencv
4
.
2
cmake
报错
参考:https://blog
.
csdn
.
net/qq_3
4
2
56375/article/details/107836051
https://docs
.
opencv
.
org/
4
.
2
.
0/d7/d9f/tutorial_linux_install
.
html
备注:
安装
过程尽量官方文档
$
cmake
-D
OPENCV
_EXTRA_MODULES_PATH=~/
opencv
_contrib/modules
CMAKE
_C_COMPILER=/usr
CMake
Error: The following variables are used in this project, but they are set to NOTFOUND
.
Please set them or make sure they are set and tested correctly in the
CMake
files:
CUDA_nppi_LIBRARY (ADVANCED)
linked by target “
opencv
_test_core” in directory /h
sll@sll-virtual-machine:~/下载/
opencv
-
2
.
4
.
9/release$
cmake
-D
CMAKE
_BUILD_TYPE=RELEASE -D
CMAKE
_INSTALL_PREFIX=/usr/local
.
.
CMake
Deprecation Warning at
CMake
Lists
.
txt:
4
7 (
cmake
_policy):
The OLD be
.
.
.
由于在
cmake
时会出现
CMake
Error at
cmake
/
OpenCV
DetectCXXCompiler
.
cmake
:85 (list)
错误
,因此替换
OpenCV
DetectCXXCompiler
.
cmake
文件
cd /home/jerry/workspaces/DynaSlam_ws/
opencv
-
2
.
4
.
11
/
opencv
-
2
.
4
.
11
/
cmake
mv
OpenCV
DetectCXXCompiler
.
cmake
OpenCV
DetectCXXCompiler
.
cmake
.
bak
欢迎使用Markdown编辑器
你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。
我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功能,我们增加了如下几点新功能,帮助你用它写博客:
全新的界面设计 ,将会带来全新的写作体验;
在创作中心设置
.
.
.
ubuntu
kylin 1
4
.
04
opencv
2
.
4
.
11
由于某些软件包对
opencv
2
.
4
的支持暂不更新到
opencv
3二、下载
opencv
在
opencv
官网下载源代码:https://github
.
com/Itseez/
opencv
/archive/
2
.
4
.
11
.
zip
然后解压得到
opencv
-
2
.
4
.
11
文件夹,我把它放在主文件夹~/下面三、
安装
openc
我的环境是
ubuntu
18
04
+pcl1
.
9
.
1+
opencv
3
.
1
.
0,为了解决该
错误
,又装了一个
opencv
3
.
4
.
8,现在是两个
opencv
共存的状态。
最近在学习高翔博士的SLAM十四讲,在运行第九讲0
.
2
工程时,需要
安装
VIZ模块,这个模块是在
opencv
库
cmake
时可选的,我就回去重新
cmake
了一次,结果提示
错误
:invalid use of incomplete type ‘class vtkTexture’。
为了解决这个
错误
,我试过以下办法
1
.
卸载VIZ8
.
2
版本,装VIZ6
.
打开终端,
安装
以下软件包
sudo apt install build-essential
sudo apt install
cmake
git libgtk
2
.
0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt install python-dev python-numpy libtbb
2
libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjas
安装
opencv
-
2
.
4
.
10,执行make -j7时报如下
错误
:
问题1: ffmpeg
错误
[ 17%] Building CXX object modules/highgui/
CMake
Files/
opencv
_highgui
.
dir/src/grfmt_exr
.
cpp
.
o
In file included from /home/hri/MyInstallSoftware/
opencv
-
2
.
.
.
.
OpenCV
4
.
x进行
Cmake
时
报错
"Error in configuration process,project files may be invalid"
查看
错误
日志,如下:
Detected processor: AMD6
4
sizeof(void) =
4
on 6
4
bit processor
.
Assume 3
2
-bit compilation mode
Found PythonInterp: C:/Users/Administrator/AppData/Local/Programs/Pyt