close

非常重要:



1.先安装 libgtk2.0-dev 和
pkg-config,,否则后期编译运行程序会出现类似如下的问题:



OpenCV Error: Unspecified error (The function is not implemented.
Rebuild the library with Windows, GTK+ 2.x or Carbon support. If
you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config,
then re-run cmake or configure script) in cvNamedWindow, file
/usr/local/opencv/OpenCV-2.0.0/src/highgui/window.cpp, line
100 

terminate called after throwing an instance of 'cv::Exception'






我深受其害……



 



2.cd 命令进入相应的下载目录。依次运行下列命令




1
 tar xf OpenCV-2.3.1.tar.bz2


2
 cd OpenCV-2.3.1



3.终端运行  




1
 mkdir build 


2
 cd build


3
 cmake ..   此处为cmake空格后面两个点。



 



4
依次运行 
 




1
 make


2
 sudo make install



 此时编译成功。



5
现在需要配置必要的库。运行 
sudo gedit
/etc/ld.so.conf.d/opencv.conf



添加这句命令到文件中,/usr/local/lib,文件或许是空的,不影响。




运行此命令  sudo ldconfig



7
现在运行这条命令 
sudo gedit
/etc/
bash.bashrc,添加下面两行到文件的末尾并保存。




1
 PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig


2
 export PKG_CONFIG_PATH



arrow
arrow
    全站熱搜
    創作者介紹
    創作者 lsx121924 的頭像
    lsx121924

    lsx121924的部落格

    lsx121924 發表在 痞客邦 留言(0) 人氣()