Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

How to integrate OpenCV in a C++ project build by gradle

$
0
0
I set up a hello world project [here](https://bitbucket.org/BenNG/hello-cpp/src/11e229362b4788afb24d99f16f40a8c93c496770?at=master) which is basically a copy/paste of the samples from the gradle project [here](https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/native-binaries/cpp). My next step is a hello world but for the OpenCV framework. It's going to read a picture in memory and display it. To be precise, the main.cpp will we more like that #include #include using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out \n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image.data ) { printf("No image data \n"); return -1; } namedWindow("Display Image", WINDOW_AUTOSIZE ); imshow("Display Image", image); waitKey(0); return 0; } As you can see I include the OpenCV header but I'm struggling adding the lib itself via gradle. I probably have to use the [prebuilt](https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/native-binaries/prebuilt) way but I fail. any ideas ? Thank you!

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>