无法在QT项目中添加iOS OpenCV框架 [英] Can't add iOS OpenCV Framework in a QT Project

查看:135
本文介绍了无法在QT项目中添加iOS OpenCV框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将可用于iOS的OpenCV框架绑定到Qt 5.2 iOS项目.到目前为止,没有任何有用的结果.

I'm trying to bind the OpenCV Framework which is available for iOS to a Qt 5.2 iOS Project. So far without any useful result.

有效的方法是创建没有任何OpenCV框架绑定的Qt项目,然后生成带有地震的Xcode项目(使用命令"qmake -spec macx-xcode qtopencv.pro"),然后手动将iOS OpenCV框架添加到Xcode项目.然后,生成的应用程序将在OpenCV支持下完美运行.但是,如果要向项目中添加文件或影响项目结构的内容,则需要使用qmake并每次手动添加OpenCV Framework.

What works is to create the Qt Project without any OpenCV Framework bind, then generate a Xcode Project with quake (using command "qmake -spec macx-xcode qtopencv.pro") and then manually add the iOS OpenCV Framework to the Xcode Project. The resulting App then runs perfectly with OpenCV Support. But if I want to add a File to the Project or something effecting the Project structure then I need to use qmake and add the OpenCV Framework manually every time.

因此,我需要一种方法来告诉QT项目使用已经存在的OpenCV iOS框架并自动使用它.在对qmake进行了一些研究之后,我发现可以添加Mac/iOS框架.

So I need a way to tell the QT Project to use the already existing OpenCV iOS Framework and using it automatically. After doing some research on qmake I found out that there is the possibility to add an Mac/iOS Framework.

使用QT Pro文件中的以下命令,似乎将Frameworkfiles添加到了项目中(由于可以在qmake生成的Xcode项目的框架"部分中找到OpenCV框架,因此似乎正确地将其添加到了Project中):

Using following commands in the QT Pro file the Frameworkfiles seem to be added to the Project (The OpenCV Framework seems to be correctly added into the Project as it can be found in the Framework section in the qmake generated Xcode Project):

QMAKE_LFlags += -F"/Users/divdurch0/Desktop/qtopencv/OpenCV.framework"
LIBS += -framework "/Users/divdurch0/Desktop/qtopencv/OpenCV.framework"

但是现在该项目没有编译为"ld:找不到框架-L/Users/divdurch0/Qt5.2.1/ios/plugins/platforms".提到的路径不是Framework,而是lib,如果我不添加上面提到的行,则可以正确地找到Lib,因此应该不是问题.

But now the Project is not compiling saying "ld:framework not found -L/Users/divdurch0/Qt5.2.1/ios/plugins/platforms". The mentioned path is not an Framework it is a lib and is correctly found as Lib if I don't add above mentioned lines - so it shouldn't be the problem.

如果我按照网上几个答案中的描述将第二行更改为

if I change the second line as described in several answers on the net to

LIBS += -framework OpenCV

它说未找到Framework OpenCV,并且没有将Framework文件添加到生成的qmake Xcode项目中.

it says Framework OpenCV not found and the Framework files aren't added to the qmake resulting Xcode Project.

我希望有人知道该怎么做.一定有一种方法,也许我使用了错误的语法.或将OpenCV框架添加到iOS QT项目中的任何其他方法将很有帮助.

I hope someone knows how to do this. There must be a way maybe I am using the wrong syntax. Or any other way to add the OpenCV Framework to a iOS QT Project will be helpful.

谢谢.

推荐答案

http SGaist://://qt-project.org/forums/viewthread/41530/#172320 :

LIBS += \
         -F /Users/divdurch0/Desktop/qtopencv \
         -framework OpenCV

你应该很好走

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

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