c++ - How to install 2 Opencv versions on one Ubuntu machine and How to activate one at a time for compilation? -


i have installed 2 versions of opencv in ubuntu12.04 machine , 1 in /usr/local/ (opencv3.0.0) , in /usr/ (opencv2.4.9). activate particular version using these commands in terminals. example :to activate opencv2.4.9,

sudo sh -c 'echo "/usr/" > /etc/ld.so.conf.d/opencv.conf' (shell script) sudo ldconfig export pkg_config_path=/usr/lib/pkgconfig 

after executing these commands version changing. checked command, pkg-config --modversion opencv. compiled code , checked used libraries, using ldd command, listing opencv3.0.0 version not opencv2.4.9.

please correct way of switching opencv versions.

thanks in advance

thank you,

i found solution problem, not sure solution iifound correct way or not. working fine me.

when install 2 versions of opencv in different locations,we found 2 opencv.pc file in {path}/lib/pkgconfig/opencv.pc. in above example opencv2.4.9's opencv.pc file in path usr/lib/pkgconfig/opencv.pc. , opencv3.0.0's opencv.pc file in path /usr/local/lib/pkgconfig/opencv.pc when compile code search in both location opencv.pc configuration file, use ever first getting, neglecting second one.
if want compile code particular version need remove opencv.pc file location.

if want use opencv2.4.9 remove(or rename)opencv.pc opencv3.0.0's lib/pkgconfig/ location. again if want activate opencv3.0.0 add opencv.pc lib/pkgconfig/ location , remove opencv2.4.9's opencv.pc file /lib/pkgconfig/opencv.pc.

if knows better way this, please comment.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -