在ubuntu中让c++版opencv不同版本共存

安装过程过后补齐,现在只有使用过程

 

1.在用户目录下。

vim .bashrc

在.bashrc中添加如下内容:

export PKG_CONFIG_PATH=~/.programdata/opencv3/build/installed/lib/pkgconfig
export LD_LIBRARY_PATH=~/.programdata/opencv3/build/installed/lib

添加完毕。

运行:

source .bashrc

2.在c++工程目录中的CMakeLists.txt文件中,加入:

set( OpenCV_DIR "~/.programdata/opencv3/build" )

即可使用旧版本opencv编译。

3.回复默认版本方法

去除.bashrc中后加入内容

去除CMakeLists.txt中的后加入内容

 

posted @ 2022-07-03 21:01  angbors  阅读(115)  评论(0)    收藏  举报