PDA

View Full Version : Can't add iOS OpenCV Framework in a QT Project



mqa
15th April 2014, 14:09
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.

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.

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.

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"

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

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

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.

Thanks.

mqa
17th April 2014, 11:47
Answered at http://qt-project.org/forums/viewthread/41530/#172320 by SGaist :


Hi and welcome to devnet,
LIBS += \
-F /Users/divdurch0/Desktop/qtopencv \
-framework OpenCV
And you should be good to go

Need programers to hire ? www.edeltech.ch