OpenCV Installing for Ubuntu
1. Download the OpenCV file. like OpenCV-2.4.3.tar.bz2
2.
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev cmake libswscale-dev libjasper-dev tar xf OpenCV-2.4.3.tar.bz2 mv OpenCV-2.4.3 opencv cd opencv/ mkdir release cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. make sudo make install
前几次失败的原因主要是,需要的工具没有安装成功,如lib*-dev便开始cmake导致出错。
-l参数就是用来指定程序要链接的库,-l参数紧接着就是库名,那么库名跟真正的库文件名有什么关系呢?就拿数学库来说,他的库名是m,他的库文件名是libm.so,很容易看出,把库文件名的头lib和尾.so去掉就是库名了 source: http://www.cnblogs.com/benio/archive/2010/10/25/1860394.html |
source: http://www.cnblogs.com/JohnShao/archive/2011/09/22/2184653.html
6 运行此命令
1 PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
2 export PKG_CONFIG_PATH |