Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Regular Contributor
_NishantShah
Posts: 75
Registered: ‎07-31-2012
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 += ../src
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.

 

Regards,

Nishant Shah

Please use plain text.
New Developer
xnike
Posts: 17
Registered: ‎11-04-2011
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"/>

Please use plain text.