【问题标题】:Can't run OpenCV example in OSX Yosemite (Macbook 8,1)无法在 OSX Yosemite (Macbook 8,1) 中运行 OpenCV 示例
【发布时间】:2015-07-01 08:19:13
【问题描述】:

我想使用 Macbook Pro 8,1 和 XCode 在 OSX Yosemite 上运行 OpenCV (opencv-3.0.0-beta)。但我遇到了一些问题。

我使用的代码:

#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);

    }

}

我有四个问题..

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)

搜索路径的设置是:

  • 始终搜索用户路径 = 是
  • 框架搜索路径 = /usr/local/lib
  • 标题搜索路径 = /usr/local/include
  • 库 搜索路径 = "MyOpenCV-Folder"/build/lib

**有人可以帮忙吗?

如果您需要更多信息,请告诉我。 你会得到它们的:p

谢谢!**

【问题讨论】:

  • 您可能忘记实际链接 OpenCV 库,请参见例如Linking the Libraries
  • 链接库后构建成功 :-) 非常感谢!

标签: c++ xcode macos opencv


【解决方案1】:

将我的评论转换为答案:

您可能忘记实际链接 OpenCV 库。 需要明确指定库,this link 显示了您需要如何在 Xcode 中执行此操作。

【讨论】:

    猜你喜欢
    • 2015-05-24
    • 1970-01-01
    • 1970-01-01
    • 2018-07-16
    • 2015-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-28
    相关资源
    最近更新 更多