Sunday, October 12, 2014

CentOS 6.5 OpenCV compilation & execution problems

$echo `pkg-config --cflags --libs opencv`               
Package opencv was not found in the pkg-config search path.                    
Perhaps you should add the directory containing `opencv.pc'                    
to the PKG_CONFIG_PATH environment variable                                    
No package 'opencv' found  

$ ls /usr/local/lib/pkgconfig
libnl-1.pc  libnl-3.0.pc  libnl-cli-3.0.pc  libnl-genl-3.0.pc  libnl-nf-3.0.pc  libnl-route-3.0.pc  opencv.pc

$export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

$ echo `pkg-config --cflags --libs opencv`

-I/usr/local/include/opencv -I/usr/local/include /usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_ocl.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so -lrt -lpthread -lm -ldl   


$g++ letter_recog.cpp -o letter_recog `pkg-config --cflags --libs opencv`



$./letter_recog                                                                                              
./letter_recog: error while loading shared libraries: libopencv_calib3d.so.2.4: cannot open shared object file: No such file or directory
                                                                                                                 
$export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib  


No comments:

Ubuntu Forware port 80

  #!/bin/bash iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8069 iptables -t nat -A PREROUTING -i eth0 -p tc...