在Xcode中链接OpenCV库 [英] Linking OpenCV libraries in Xcode

查看:185
本文介绍了在Xcode中链接OpenCV库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我刚刚使用CMake安装了OpenCV 2.4.0,两个相关的文件夹似乎位于usr/local/include/opencv和usr/local/include/opencv2.但是,在将它们与Xcode 4.2实际链接以在iphone应用程序中使用时,我完全不知所措.我一直在网上寻找解决方案,尽管有些解决方案存在,但我要么没有正确执行步骤,要么在正确的位置似乎没有正确的文件/文件夹,尽管我非常确定安装正确.对于新手的任何帮助将不胜感激!

So I just installed OpenCV 2.4.0 using CMake, and the two relevant folders seem to be at usr/local/include/opencv and usr/local/include/opencv2. However, I'm at a complete loss when it comes to actually linking these with Xcode 4.2 for using it in an iphone app. I've been searching online for a solution, and while some exist, I'm either not doing the steps right nor do I seem to have the right files/folders in the right places, although I'm pretty sure it was installed correctly. Any help for a newbie would be much appreciated!

推荐答案

我希望这不是导致盲人的盲人.我用xcode选项跑了cmake:

I hope this is not the blind leading the blind here. I ran cmake with the xcode option:

cmake -G"Xcode" -D WITH_TIFF = OFF -D BUILD_EXAMPLES = ON ..

cmake -G "Xcode" -D WITH_TIFF=OFF -D BUILD_EXAMPLES=ON ..

我没有看到有关如何使用-G"Xcode"选项的教程,所以这是我的2c价值.

I do not see tutorials on how to proceed with the -G "Xcode" option, so here's my 2c worth.

更新:找到了一个使用-G"Xcode"的博客:构建OpenCV用于雪豹

Update:found a blog that uses -G "Xcode":Building OpenCV for Snow Leopard

经过一番摸索之后,我在xcode构建目录中得到了结果, opencv/build/lib/Debug.

After a LOT of thrashing I got results in my xcode build directories, opencv/build/lib/Debug.

我只是编译命令行实用程序,所以我设置了一个新的命令行目标,并且 在我的目标设置中的链接库"部分下,我必须添加所有这些库.

I am just compiling command line utilities, so I set a new command line target, and in my target settings, under the 'Linked Libraries' section, I had to add all those libraries.

抱歉,这有点含糊.在所有步骤中,我都记不清.

Sorry if that is all a bit vague. I didn't keep very good notes on all the steps.

因此,请查看是否需要在目标设置中添加一些链接库".

So, see if you need to add some 'Linked Libraries' in your target settings.

在SE上,请参见:此信息

这篇关于在Xcode中链接OpenCV库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆