本文介绍了无法将opencv2-2框架添加到iOS项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将opencv2-2(最新版本)框架添加到我的iOS项目中,但是在构建时遇到此错误.

I'm trying to add the opencv2-2 (the latest release) framework to my iOS project, but I am encountering this error when I build.

clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

clang: error: linker command failed with exit code 1 (use -v to see invocation)

opencv2-2框架显示在构建阶段"选项卡的与库链接二进制文件"部分中.如果相关,这是我在ViewController.m中的import语句:

The opencv2-2 framework appears in the Link Binary with Libraries section of the Build Phases tab. If it's relevant, this is my import statement in ViewController.m:

#ifdef __cplusplus
#import <opencv2-2/core.hpp>
#endif

以下是屏幕截图:

我在做什么错了?

推荐答案

您的框架文件应命名为opencv2.framework,而导入语句应为#import <opencv2/core.hpp>.

Your framework file should be named opencv2.framework and your import statement should be #import <opencv2/core.hpp>.

我不确定您在哪里输入了错误的名称opencv2-2.也许您下载了两次opencv2.framework,而Mac自动将第二个副本重命名为opencv2-2.framework.

I'm not sure where you got the incorrect name opencv2-2. Maybe you downloaded opencv2.framework twice and Mac automatically renamed the second copy to opencv2-2.framework.

这篇关于无法将opencv2-2框架添加到iOS项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 04:36