{"id":51355,"date":"2024-10-08T17:55:17","date_gmt":"2024-10-08T09:55:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/51355\/"},"modified":"2024-11-14T10:43:37","modified_gmt":"2024-11-14T02:43:37","slug":"ubuntu-16-04-lts-%e5%ae%89%e8%a3%9d-opencv-3-1-0-%e5%8f%8a-usr-bin-ld-%e6%89%be%e4%b8%8d%e5%88%b0-lippicv","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/51355\/","title":{"rendered":"Ubuntu 16.04 LTS \u5b89\u88dd OpenCV-3.1.0 \u53ca \/usr\/bin\/ld: \u627e\u4e0d\u5230 -lippicv"},"content":{"rendered":"<h1 id=\"ubuntu-16-04-lts-%e5%ae%89%e8%a3%9d-opencv-3-1-0-%e5%8f%8a-usr-bin-ld-%e6%89%be%e4%b8%8d%e5%88%b0-lippicv-UGpkhjNGdn\">Ubuntu 16.04 LTS \u5b89\u88dd OpenCV-3.1.0 \u53ca \/usr\/bin\/ld: \u627e\u4e0d\u5230 -lippicv<\/h1>\n<p>\u5728\u8a08\u7b97\u6a5f\u8996\u89ba\u9818\u57df\uff0cOpenCV\uff08Open Source Computer Vision Library\uff09\u662f\u4e00\u500b\u975e\u5e38\u6d41\u884c\u7684\u958b\u6e90\u5eab\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u5716\u50cf\u8655\u7406\u548c\u8a08\u7b97\u6a5f\u8996\u89ba\u4efb\u52d9\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 Ubuntu 16.04 LTS \u4e0a\u5b89\u88dd OpenCV 3.1.0\uff0c\u4e26\u89e3\u6c7a\u5728\u5b89\u88dd\u904e\u7a0b\u4e2d\u53ef\u80fd\u9047\u5230\u7684\u932f\u8aa4\u8a0a\u606f\u300c\/usr\/bin\/ld: \u627e\u4e0d\u5230 -lippicv\u300d\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-opencv-3-1-0-%e7%9a%84%e6%ad%a5%e9%a9%9f-UGpkhjNGdn\">\u5b89\u88dd OpenCV 3.1.0 \u7684\u6b65\u9a5f<\/h2>\n<h3 id=\"1-%e6%9b%b4%e6%96%b0%e7%b3%bb%e7%b5%b1-UGpkhjNGdn\">1. \u66f4\u65b0\u7cfb\u7d71<\/h3>\n<p>\u9996\u5148\uff0c\u78ba\u4fdd\u4f60\u7684\u7cfb\u7d71\u662f\u6700\u65b0\u7684\u3002\u6253\u958b\u7d42\u7aef\u6a5f\uff0c\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo apt-get update\nsudo apt-get upgrade<\/code><\/pre>\n<h3 id=\"2-%e5%ae%89%e8%a3%9d%e5%bf%85%e8%a6%81%e7%9a%84%e4%be%9d%e8%b3%b4%e5%8c%85-UGpkhjNGdn\">2. \u5b89\u88dd\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305<\/h3>\n<p>\u5728\u5b89\u88dd OpenCV \u4e4b\u524d\uff0c\u9700\u8981\u5b89\u88dd\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\u3002\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev\nsudo apt-get install libjpeg-dev libpng-dev libtiff-dev\nsudo apt-get install libatlas-base-dev gfortran\nsudo apt-get install python2.7-dev python3-dev<\/code><\/pre>\n<h3 id=\"3-%e4%b8%8b%e8%bc%89-opencv-3-1-0-UGpkhjNGdn\">3. \u4e0b\u8f09 OpenCV 3.1.0<\/h3>\n<p>\u63a5\u4e0b\u4f86\uff0c\u4e0b\u8f09 OpenCV 3.1.0 \u7684\u6e90\u78bc\u3002\u53ef\u4ee5\u4f7f\u7528 git \u4f86\u514b\u9686 OpenCV \u7684 GitHub \u5009\u5eab\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/opencv\/opencv.git\ncd opencv\ngit checkout 3.1.0<\/code><\/pre>\n<h3 id=\"4-%e5%89%b5%e5%bb%ba%e6%a7%8b%e5%bb%ba%e7%9b%ae%e9%8c%84-UGpkhjNGdn\">4. \u5275\u5efa\u69cb\u5efa\u76ee\u9304<\/h3>\n<p>\u5728 OpenCV \u76ee\u9304\u4e2d\u5275\u5efa\u4e00\u500b\u69cb\u5efa\u76ee\u9304\uff1a<\/p>\n<pre><code>mkdir build\ncd build<\/code><\/pre>\n<h3 id=\"5-%e9%85%8d%e7%bd%ae-cmake-UGpkhjNGdn\">5. \u914d\u7f6e CMake<\/h3>\n<p>\u4f7f\u7528 CMake \u914d\u7f6e OpenCV\u3002\u9019\u4e00\u6b65\u6703\u6aa2\u67e5\u7cfb\u7d71\u74b0\u5883\u4e26\u751f\u6210 Makefile\uff1a<\/p>\n<pre><code>cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=\/usr\/local ..<\/code><\/pre>\n<h3 id=\"6-%e7%b7%a8%e8%ad%af%e5%92%8c%e5%ae%89%e8%a3%9d-opencv-UGpkhjNGdn\">6. \u7de8\u8b6f\u548c\u5b89\u88dd OpenCV<\/h3>\n<p>\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f86\u7de8\u8b6f\u548c\u5b89\u88dd OpenCV\uff1a<\/p>\n<pre><code>make -j4\nsudo make install<\/code><\/pre>\n<h2 id=\"%e8%a7%a3%e6%b1%ba-usr-bin-ld-%e6%89%be%e4%b8%8d%e5%88%b0-lippicv-%e9%8c%af%e8%aa%a4-UGpkhjNGdn\">\u89e3\u6c7a \/usr\/bin\/ld: \u627e\u4e0d\u5230 -lippicv \u932f\u8aa4<\/h2>\n<p>\u5728\u7de8\u8b6f\u904e\u7a0b\u4e2d\uff0c\u53ef\u80fd\u6703\u9047\u5230\u932f\u8aa4\u8a0a\u606f\u300c\/usr\/bin\/ld: \u627e\u4e0d\u5230 -lippicv\u300d\u3002\u9019\u901a\u5e38\u662f\u56e0\u70ba\u7f3a\u5c11 ippicv \u5eab\u3002\u8981\u89e3\u6c7a\u9019\u500b\u554f\u984c\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<h3 id=\"1-%e7%a2%ba%e8%aa%8d-ippicv-%e5%ba%ab%e7%9a%84%e5%ad%98%e5%9c%a8-UGpkhjNGdn\">1. \u78ba\u8a8d ippicv \u5eab\u7684\u5b58\u5728<\/h3>\n<p>\u9996\u5148\uff0c\u6aa2\u67e5\u4f60\u7684\u7cfb\u7d71\u4e2d\u662f\u5426\u5df2\u7d93\u5b89\u88dd\u4e86 ippicv \u5eab\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u627e\uff1a<\/p>\n<pre><code>locate libippicv<\/code><\/pre>\n<h3 id=\"2-%e4%b8%8b%e8%bc%89%e5%92%8c%e5%ae%89%e8%a3%9d-ippicv-UGpkhjNGdn\">2. \u4e0b\u8f09\u548c\u5b89\u88dd ippicv<\/h3>\n<p>\u5982\u679c\u6c92\u6709\u627e\u5230\uff0c\u5247\u9700\u8981\u624b\u52d5\u4e0b\u8f09\u548c\u5b89\u88dd ippicv\u3002\u53ef\u4ee5\u5f9e OpenCV \u7684 GitHub \u5009\u5eab\u4e2d\u627e\u5230\u76f8\u95dc\u7684\u5eab\u6587\u4ef6\uff0c\u7136\u5f8c\u5c07\u5176\u653e\u7f6e\u5728\u9069\u7576\u7684\u76ee\u9304\u4e2d\u3002<\/p>\n<h3 id=\"3-%e6%9b%b4%e6%96%b0-cmake-%e9%85%8d%e7%bd%ae-UGpkhjNGdn\">3. \u66f4\u65b0 CMake \u914d\u7f6e<\/h3>\n<p>\u5728 CMake \u914d\u7f6e\u4e2d\uff0c\u6dfb\u52a0 ippicv \u7684\u8def\u5f91\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u91cd\u65b0\u914d\u7f6e\uff1a<\/p>\n<pre><code>cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=\/usr\/local -D OPENCV_EXTRA_MODULES_PATH=..\/..\/opencv_contrib\/modules ..<\/code><\/pre>\n<h3 id=\"4-%e9%87%8d%e6%96%b0%e7%b7%a8%e8%ad%af-opencv-UGpkhjNGdn\">4. \u91cd\u65b0\u7de8\u8b6f OpenCV<\/h3>\n<p>\u6700\u5f8c\uff0c\u91cd\u65b0\u7de8\u8b6f OpenCV\uff1a<\/p>\n<pre><code>make -j4\nsudo make install<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-UGpkhjNGdn\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Ubuntu 16.04 LTS \u4e0a\u5b89\u88dd OpenCV 3.1.0 \u7684\u904e\u7a0b\u4e2d\uff0c\u53ef\u80fd\u6703\u9047\u5230\u4e00\u4e9b\u6311\u6230\uff0c\u4f8b\u5982\u300c\/usr\/bin\/ld: \u627e\u4e0d\u5230 -lippicv\u300d\u7684\u932f\u8aa4\u3002\u901a\u904e\u5b89\u88dd\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\u3001\u4e0b\u8f09 ippicv \u5eab\u4e26\u6b63\u78ba\u914d\u7f6e CMake\uff0c\u53ef\u4ee5\u9806\u5229\u5b8c\u6210\u5b89\u88dd\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u80fd\u8a08\u7b97\u7684\u61c9\u7528\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u65b9\u6848\u5c07\u6709\u52a9\u65bc\u63d0\u5347\u904b\u884c\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install OpenCV 3.1.0 on Ubuntu 16.04 LTS and troubleshoot the &#8220;\/usr\/bin\/ld: cannot find -lippicv&#8221; error effectively.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-51355","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=51355"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51355\/revisions"}],"predecessor-version":[{"id":51356,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51355\/revisions\/51356"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=51355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=51355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=51355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}