C&C++   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了c – Opencv,命令行中缺少DSO collect2:错误:ld返回1退出状态大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我将OpenCV安装到Ubuntu 14.04.我正试图在opencv网站上休闲教程.运行此代码时出错.我正在使用 eclipse
运行代码.我在构建项目时遇到此@L_674_3@.
我向g链接添加了opencv_core,opencv_highgui,opencv_imgcodecs库.

Error message: 

//usr/local/lib/libopencv_imgproc.so.3.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [optest01] Error 1

代码

#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>

using namespace cv;

/// Global variables

Mat src,src_gray;
Mat dst,detected_edges;

/** @function main */
int main( int argc,char** argv )
{
  /// Load an image
  src = imread( "/images/Lenna.jpg" );

  if( !src.data )
  { return -1; }

  /// Create a matrix of the same type and size as src (for dst)
  dst.create( src.size(),src.type() );

  /// Convert the image to grayscale
  cvtColor( src,src_gray,COLOR_BGR2GRAY );

  return 0;
  }

解决方法

你的@L_674_3@代码

告诉你,你没有链接opencv_imgproc.
只需链接所需的库:

-lopencv_imgproc

大佬总结

以上是大佬教程为你收集整理的c – Opencv,命令行中缺少DSO collect2:错误:ld返回1退出状态全部内容,希望文章能够帮你解决c – Opencv,命令行中缺少DSO collect2:错误:ld返回1退出状态所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。