Ask Your Question

FERNman's profile - activity

2020-06-30 04:46:01 -0600 received badge  Nice Question (source)
2020-03-19 14:21:19 -0600 received badge  Notable Question (source)
2019-02-14 04:21:42 -0600 received badge  Popular Question (source)
2018-12-04 01:53:02 -0600 received badge  Enlightened (source)
2018-12-04 01:53:02 -0600 received badge  Good Answer (source)
2018-05-17 15:07:03 -0600 received badge  Nice Answer (source)
2018-05-17 15:06:58 -0600 received badge  Student (source)
2017-12-12 03:00:27 -0600 received badge  Teacher (source)
2017-12-12 02:31:25 -0600 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 -0600 received badge  Self-Learner (source)
2017-12-12 02:22:59 -0600 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 -0600 received badge  Enthusiast
2017-11-28 08:08:03 -0600 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 -0600 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