Configuration OpenCV for iOS
-
wrote on 24 Apr 2018, 03:49 last edited by
Hello there;
I have a problem with integrating opencv library and Qt Creator 4.5.0 on Qt 5.10.0;
following instructions i added opencv to .pro file like this:macx { LIBS += -L/usr/local/lib CONFIG += link_pkgconfig PKGCONFIG += opencv }
and it works properly on Mac; but i tried to deploy it on iOS by adding opencv framework:
ios { LIBS += \ -F $$PWD/ios \ -framework opencv2 }
and it's not working , i have 2 error here ,
- "No such file or directory" on #include opencv
- "symbol(s) not found for architecture arm64"
would you please help me to show me my mistake and maybe solve it?
Thank you
-
Hi and welcome to devnet,
Did you compile OpenCV for iOS ?
If so, did you compile what architecture did you compile it for ?
If not, how did you obtain it ?The include statement you show looks wrong, what's the real one ?
-
wrote on 24 Apr 2018, 08:20 last edited by Discode
Hi SGaist and Thanks for replay;
I tried compile it and make opencv.framework from an instruction with terminal
and i have a framework file and a folder "build" beside it that's include various architects ;
but seems i did something wrong. (it's not working)#include "opencv2/opencv.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp"
i am using same codes for Mac and iOS, my codes are working on Mac properly
-
Where did you get the instructions from ?
What exactly do you have in the resulting framework ?
-
Where did you get the instructions from ?
What exactly do you have in the resulting framework ?
wrote on 25 Apr 2018, 06:17 last edited by@SGaist
I use this link to compile opencv framework:
https://docs.opencv.org/2.4/doc/tutorials/introduction/ios_install/ios_install.htmland in result i have a folder "ios" which contains framework and build subfolder
https://drive.google.com/open?id=1S1fN2aSXxcNhobXQxPLqMVM1_PLdNsOY -
Did you check that the framework you are linking to does indeed contain all the required architectures ?
-
Did you check that the framework you are linking to does indeed contain all the required architectures ?
wrote on 26 Apr 2018, 02:39 last edited by@SGaist said in Configuration OpenCV for iOS:
Did you check that the framework you are linking to does indeed contain all the required architectures ?
Yes , i checked architectures before open this topic,
below is getting lipo -info from my framework:
localhost:opencv2.framework username$ lipo -info opencv2
Architectures in the fat file: opencv2 are: armv7 armv7s i386 x86_64 arm64 -
Then did you check that the linker does indeed find your self-built framework of OpenCV ?
-
wrote on 27 Apr 2018, 02:42 last edited by Discode
Dear @SGaist :
Actually this "opencv2.framework" is working properly in XCode, i'm not a professional but i think something wrong is linking Qt to framework ;
How i can check that linker in my project ?
Just for remembrance i have the yellow line on "#include "opencv2/opencv.hpp" and tooltip says : "No such file or directory". -
Just realized:
@Discode said in Configuration OpenCV for iOS:-F $$PWD/ios
You are using that option wrong, remove that space between the capital
F
and the$
1/10