1. 程式人生 > >opencv程式編譯後執行找不到庫

opencv程式編譯後執行找不到庫

方法一:

在ubuntu下編譯opencv程式後,執行報下面到錯誤:

error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
解決方法:找到libopencv_開頭到庫的目錄,在/usr/local/lib下面,在/etc/ld.so.conf.d/下面新建一個opencv.conf,裡面寫入/usr/local/lib,最後執行下sudo ldconfig -v即可。
參考:http://stackoverflow.com/questions/12335848/opencv-program-compile-error-libopencv-core-so-2-4-cannot-open-shared-object-f


方法二: