AnsweredAssumed Answered

Build failed while builidng opencv recipe!!

Question asked by harsh basarikodi on Jan 15, 2018
Latest reply on Jan 15, 2018 by igorpadykov

(Target machine: Wandboard quad version c, Host machine Ubuntu 14.04,and using Yocto Jethro branch)

I am trying to compile the sample opencv code.
I have created a recipe  following the instruction yocto manual.

 

Initially I have added all the libraries related to openCv
by referring the below link.

www.engcore.com/2014/02/building-opencv-2-4-x-for-freescales-imx6-bsp-yocto
Then i gave bitbake core-image-x11.
I was able to build successfully.

(I verified the building of the cpp file by creating a simple .cpp file, It compiled correctly)


Next, I created a recipe and added the .cpp code related to opencv.Changed the recipe.bb file to compile .cpp file.

 

I am not able to compile the recipe .
Please let me know the steps followed are correct or not.

Below is the error.
In `main':
| helloworld.cpp:(.text+0x68): undefined reference to `cv::VideoCapture::VideoCapture()'

 

Any additional library i need to include in the .bb file while building receipe?

Below is the source code used for building!!!

#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <iostream>
int main(int, char**) {   
cv::VideoCapture vcap;   
cv::Mat image;     // This works on a D-Link CDS-932L   
const std::string videoStreamAddress = "http://<username:password>@<ip_address>/video.cgi?.mjpg";     //open the video stream and make sure it's opened   
if(!vcap.open(videoStreamAddress)) {       
std::cout << "Error opening video stream or file" << std::endl;       
return -1;   
}    
for(;;)
{       
if(!vcap.read(image)) {           
std::cout << "No frame" << std::endl;           
cv::waitKey();       
}       
cv::imshow("Output Window", image);       
if(cv::waitKey(1) >= 0)
break;   
}  
}

Outcomes