Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Regular Contributor
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry
My Carrier: Vodafone

Import OpenCV library into Cascades project

Hi all,


I want to include OpenCV 2.2 library into my cascades project. I included following piece of code in .pro file:


LIBS += D:/OpenCV2.2/lib/*


INCLUDEPATH += D:/OpenCV2.2/include
INCLUDEPATH += D:/OpenCV2.2/include/opencv


When I build the project it doesn't produce any error. But when I try to include classes in the project it produces error:


#include <opencv/cv.h>
#include <opencv/cxcore.h>
#include <opencv/highgui.h>


Any kind of help will be highly appreciated.



Nishant Shah

Posts: 77
Registered: ‎11-04-2011
My Device: PlayBook, DAC, SQN100-3, STL100-1, STL100-2
My Carrier: MTS RUS

Re: Import OpenCV library into Cascades project

[ Edited ]

As I see you need to do following steps:

1) add to your *.pro file relative path to libs after "-L", extract shared lib names from files names (for example, libPocoFoundation.so.15 becomes PocoFoundation) and add after "-l" 

2) add relative path to includes

3) you can also try absolute path )


LIBS += -L../../POCO/lib -lPocoFoundation -lPocoNet -lPocoUtil -lPocoXML
INCLUDEPATH += ../../POCO/include


3) put your shared libs to some dir in assets and update LD_LIBRARY_PATH in bar-descriptor.xml (I create dir "lib" in assets dir)

was <env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>

now <env var="LD_LIBRARY_PATH" value="app/native/assets/lib:app/native/lib:/usr/lib/qt4/lib"/>

New Developer
Posts: 9
Registered: ‎04-05-2014
My Device: BlackBerry Z10
My Carrier: Congstar

Re: Import OpenCV library into Cascades project

Did the solution work ?