centos7 安装opencv2.4.13

进入root管理员模式下:

1.安装依赖包

yum -y install gcc gcc-c++ gtk2-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm

2.cmake安装参考:http://blog.csdn.net/sz76211822/article/details/74729272

3.官网下载opencv2.4.13.zip到usr/local
cd /usr/local
unzip opencv-2.4.13.zip
cd opencv-2.4.13/
cmake CMakeLists.txt 
make
make install
cp /usr/local/opencv-2.4.13/unix-install/opencv.pc /usr/lib64/pkgconfig/
gedit /etc/ld.so.conf.d/opencv.conf

4.创建并编辑该文件。填入
/usr/local/lib
保存关闭

ldconfig
gedit /etc/bash.bashrc

在文件后添加:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig 
export PKG_CONFIG_PATH
保存关闭

重启终端


你可能感兴趣的:(Qt,Linux,OPENCV)