久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

openCV 程序編譯錯誤“libopencv_core.so.2.4: cannot ope

openCV program compile error quot;libopencv_core.so.2.4: cannot open shared object file: No such file or directoryquot; in ubuntu 12.04(openCV 程序編譯錯誤“libopencv_core.so.2.4: cannot open shared object file: No such file or direct
本文介紹了openCV 程序編譯錯誤“libopencv_core.so.2.4: cannot open shared object file: No such file or directory"在 Ubuntu 12.04的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我在 ubuntu 12.04 中編譯并安裝了 openCV 2.4.2.在 /usr/local/include 下,我可以看到目錄 /usr/local/opencv/usr/local/opencv2.

I compiled and installed openCV 2.4.2 in ubuntu 12.04. Under /usr/local/include I can see the directories /usr/local/opencv and /usr/local/opencv2.

這是我寫的代碼:

#include <cv.h>
#include <highgui.h>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc,char **argv)
{
   Mat image;
   image = imread(argv[1],1);

   if(argc != 2 || !image.data)
   {
       cout << "No image data
";
       return -1;
   }

   namedWindow("Display Image",CV_WINDOW_AUTOSIZE);
   imshow("Display Image",image);
   waitKey(0);
   return 0;
}

我使用這個命令行編譯它:

I compiled it using this command line:

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

沒有編譯時錯誤,但是當我嘗試使用 /DisplayImage code.png 運行生成的二進制文件時,我收到以下錯誤消息:

There were no compile time errors, however when I try to run the resulting binary with /DisplayImage code.png I get the following error message:

./DisplayImage: error while loading shared libraries: libopencv_core.so.2.4: cannot open shared object file: No such file or directory

推薦答案

您沒有將共享庫放在加載程序可以找到的位置.查看 /usr/local/opencv/usr/local/opencv2 文件夾,看看它們是否包含任何共享庫(以 lib<開頭的文件)/code> 并且通常以 .so 結尾).找到它們后,創建一個名為 /etc/ld.so.conf.d/opencv.conf 的文件,并將存儲庫的文件夾的路徑寫入其中,每行一個.

You haven't put the shared library in a location where the loader can find it. look inside the /usr/local/opencv and /usr/local/opencv2 folders and see if either of them contains any shared libraries (files beginning in lib and usually ending in .so). when you find them, create a file called /etc/ld.so.conf.d/opencv.conf and write to it the paths to the folders where the libraries are stored, one per line.

例如,如果庫存儲在 /usr/local/opencv/libopencv_core.so.2.4 下,那么我會將其寫入我的 opencv.conf 文件:

for example, if the libraries were stored under /usr/local/opencv/libopencv_core.so.2.4 then I would write this to my opencv.conf file:

/usr/local/opencv/

然后運行

sudo ldconfig -v

如果找不到庫,請嘗試運行

If you can't find the libraries, try running

sudo updatedb && locate libopencv_core.so.2.4

在一個外殼中.如果您在編譯 OpenCV 后重新啟動,則不需要運行 updatedb.

in a shell. You don't need to run updatedb if you've rebooted since compiling OpenCV.

參考文獻:

關于 Linux 上的共享庫:http://www.eyrie.org/~eagle/notes/rpath.html

About shared libraries on Linux: http://www.eyrie.org/~eagle/notes/rpath.html

關于添加 OpenCV 共享庫:http://opencv.willowgarage.com/wiki/InstallGuide_Linux

About adding the OpenCV shared libraries: http://opencv.willowgarage.com/wiki/InstallGuide_Linux

這篇關于openCV 程序編譯錯誤“libopencv_core.so.2.4: cannot open shared object file: No such file or directory"在 Ubuntu 12.04的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Assertion failed (size.widthgt;0 amp;amp; size.heightgt;0)(斷言失敗(size.width0 amp;amp; size.height0))
Rotate an image in C++ without using OpenCV functions(在 C++ 中旋轉圖像而不使用 OpenCV 函數)
OpenCV: process every frame(OpenCV:處理每一幀)
Why can#39;t I open avi video in openCV?(為什么我不能在 openCV 中打開 avi 視頻?)
OpenCV unable to set up SVM Parameters(OpenCV 無法設置 SVM 參數)
Convert a single color with cvtColor(使用 cvtColor 轉換單一顏色)
主站蜘蛛池模板: 国产成年妇视频 | 伊久久 | 九九免费视频 | 久久亚洲欧美 | 国产无遮挡又黄又爽免费网站 | 日韩在线视频一区二区三区 | 日韩欧美三区 | 特级丰满少妇一级aaaa爱毛片 | 超碰在线观看免费版 | av福利网 | 日韩黄网| 欧美精品99久久久 | 国产乱码久久久久久 | 日本黄色三级视频 | 亚洲精品福利 | 亚洲综合视频在线 | 成人高潮片免费视频 | 久久久久久久久久国产精品 | 久久久精品国产sm调教 | 一级黄色片免费看 | 久久免费视频网站 | av激情网 | 伊人久久av | 国产成人网 | 午夜视频一区二区三区 | 春色导航 | 51成人做爰www免费看网站 | 金银在线 | 午夜免费在线 | 欧美性猛交一区二区三区精品 | 五月婷婷视频 | 日本少妇一区二区 | 玖玖在线视频 | av免费网站 | 欧美性生交xxxxx | 亚洲免费福利视频 | 欧美日韩一二三 | 中文有码在线 | 伊人在线视频 | 日韩一区二区在线视频 | 黄色a一级片|