简体   繁体   English

无法在OSX Yosemite中运行OpenCV示例(Macbook 8,1)

[英]Can't run OpenCV example in OSX Yosemite (Macbook 8,1)

I want to run OpenCV (opencv-3.0.0-beta) on OSX Yosemite with a Macbook Pro 8,1 and XCode. 我想在OSX Yosemite上使用Macbook Pro 8,1和XCode运行OpenCV(opencv-3.0.0-beta)。 But I get some issues. 但是我遇到了一些问题。

Code I Used: 我使用的代码:

#include <iostream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/core.hpp"

using namespace cv;

int main(){

VideoCapture cap(0);

while (true){

    Mat Webcam;
    cap.read(Webcam);
    imshow("Webcam", Webcam);

    }

}

I get four issues.. 我有四个问题..

Undefined symbols for architecture x86_64:
  "cv::VideoCapture::read(cv::_OutputArray const&)", referenced from:
      _main in main.o
  "cv::VideoCapture::VideoCapture(int)", referenced from:
      _main in main.o
  "cv::VideoCapture::~VideoCapture()", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The Settings for Search Paths are: 搜索路径的设置为:

  • Always Search User Paths = Yes 始终搜索用户路径=是
  • Framework Search Paths = /usr/local/lib 框架搜索路径= / usr / local / lib
  • Header Search Paths = /usr/local/include 标题搜索路径= / usr / local / include
  • Library Search Paths = "MyOpenCV-Folder"/build/lib Library Search Paths =“MyOpenCV-Folder”/ build / lib

**Can anybody help? **有人可以帮忙吗?

And please tell me if you need some more information. 如果您需要更多信息,请告诉我。 You'll get them :p 你会得到它们:p

Thanks!** 谢谢!**

Converting my comment in an answer: 在答案中转换我的评论:

You probably forgot to actually link against the OpenCV libraries. 您可能忘记了实际链接OpenCV库。 The libraries need to be explicitly specified, this link shows how you need to do it in Xcode. 需要明确指定库, 此链接显示了如何在Xcode中执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM