Error:(6, 10) fatal error: 'opencv2/opencv.hpp' file not found
I know that there are many threads that have some solution for this problem but I did not managed to resolve my issue with non of them.
I spent like a few days already on this compile error and still no success.
I use Android Studio and opencv 3.3.1
I got opencv .a files placed under jniLibs. I got .h file under jni with heder like this
#include "opencv2/opencv.hpp"
If I remove that include everything builds and I am also able to call cpp methods from java via JNI. But when it comes to this include it seems like something is not connected correctly
inside my CMakeLists.txt i have this
cmake_minimum_required(VERSION 3.4.0)
set(OpenCV_DIR /usr/local/Cellar/opencv/3.3.1_1/share/OpenCV)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
include_directories(
${CMAKE_SOURCE_DIR}/include
/usr/local/Cellar/opencv/3.3.1_1/ )
find_package( OpenCV REQUIRED )
My biggest problem I this moment is I do not know how to locate the problem :(. I do not know if my CMakeList.txt is wrong, or build.gradle or what else... Please help me find the problem
When I build with android studio all I got is line
Error:(6, 10) fatal error: 'opencv2/opencv.hpp' file not found
Thanks
edit1: for the SET(OpenCV_DIR "D:/libs/opencv-3.3/build/") comment
I am on Mac not on windows so my paths i little different I got
/usr/local/Cellar/opencv/3.3.1_1
and inside this path I got
INSTALL_RECEIPT.json LICENSE README.md bin include lib share
but not build
Hi I'm not 100% sure but in my cmake files under Windows I have added the following lines:
hi, @namacos, there were 10 duplicates of your question here !
it's probably not your fault, seems to happen while ppl are in the moderation queue.
however, if you recall anything, that led to this, like a flaw in the website, please let us know !
where is your OpenCV_DIR defined ?
my OpenCV_Dir is
I know I should nod duplicate things, but to be honest non of the previous duplicates solves my problem. I tried everything. I seems like a common problem for some miss-configuration but there is no obvious solution to this (at least not for beginners like me).
@VxW please see my edit, thanks
I'm not familar with Mac but what happens if you set your OpenCV_Dir to the location where your OpenCV cmake file is located?
This seems useful https://stackoverflow.com/questions/3...