Ask Your Question

FERNman's profile - activity

2019-02-14 04:21:42 -0500 received badge  Popular Question (source)
2018-12-04 01:53:02 -0500 received badge  Enlightened (source)
2018-12-04 01:53:02 -0500 received badge  Good Answer (source)
2018-05-17 15:07:03 -0500 received badge  Nice Answer (source)
2018-05-17 15:06:58 -0500 received badge  Student (source)
2017-12-12 03:00:27 -0500 received badge  Teacher (source)
2017-12-12 02:31:25 -0500 marked best answer How to build OpenCV for Android using Visual Studio?

Hello,

Short story:

Can anyone describe the process of how to use OpenCV in a C++ Project for Android in Visual Studio?


Long story:

I'm currently trying to build an OpenCV native plugin for Unity using Visual Studio. As it should be as platform independent as possible (except Linux), it's necessary to build the DLL for Windows, Android etc. That's also the reason why I'd prefer to stick to Visual Studio instead of Android Studio as it's (theoretically) possible to develop for all of those platforms there.

I already managed to setup OpenCV for UWP and Windows, however, I don't really know how to do this for Android. I already created a Visual Studio Cross-Platform C++ Project that Outputs a dynamic library (.so). It's compiling as long as I don't do anything OpenCV related in there.

My first try was to just use the normal OpenCV library for C++, but it gives me errors like "cannot use throw with exceptions disabled" and a lot more.

As a next step, I downloaded the OpenCV4Android .zip from the releases page and unzipped it. I added "OpenCV-android-sdk\sdk\native\jni\include" as additional include directory and "\OpenCV-android-sdk\sdk\native\libs\PLATFORM" as additional library directory, where "PLATFORM" is the build configuration (x64, x86, amd, etc.).

I then added "libopencv_core.a" to additional dependencies and tried to compile the whole thing, however, it says "There is no such file or directory: libopencv_core.a". If I remove it from the additional dependencies, it says "Linker command failed with exit code -1".

Also, I get a lot of errors saying "builtin function is not available because vector types are not supported".

2017-12-12 02:30:28 -0500 received badge  Self-Learner (source)
2017-12-12 02:22:59 -0500 answered a question How to build OpenCV for Android using Visual Studio?

Well, as I didn't get an answer I managed to figure out the solution myself (thanks to berak for the two links). If anyo

2017-12-06 03:03:44 -0500 received badge  Enthusiast
2017-11-28 08:08:03 -0500 commented question How to build OpenCV for Android using Visual Studio?

Thanks. Still, this is using CMake if I'm right. CMake would be my next try, but don't you think it's possible to compil

2017-11-28 07:45:15 -0500 asked a question How to build OpenCV for Android using Visual Studio?

How to build OpenCV for Android using Visual Studio? Hello, Short story: Can anyone describe the process of how to use