I'm importing a C++/OpenCV code to an Android app with NDK. First of all, I have to say that I don't have studies in programming, I'm just an amateur developer, so there're many things that I don't manage (specially, things out of coding).
I use QtCreator for my C++/OpenCV code and I wrote this line in my Project.pro:
INCLUDEPATH += path/to/OpenCV/main/dir #OpenCV-3.1.0
LIBS += -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc
Now, I'm trying to make a "Hello World!" app only to be sure that I can compile with my C++ sources.
According to https://developer.android.com/ndk/guides/android_mk.html, I wrote this simple Android.mk file:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := myModule
LOCAL_CFLAGS += -I /path/to/OpenCV/main/dir
LOCAL_LDLIBS := -lopencv_core
LOCAL_SRC_FILES := bar.cpp
include $(BUILD_SHARED_LIBRARY)
In bar.cpp, I have:
#include <opencv2/core/core.hpp>
Just for checking that the compiler can found the sources. When I try to build my C++/OpenCV native code using ndk-build, I get:
non-system libraries in linker flags: -lopencv_core
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the current module
I tryed to use LOCAL_STATIC_LIBRARIES and LOCAL_SHARED_LIBRARIES, but no succed. Any ideas?
P.S.:
It's important to say that I compiled a simple Hello world using NDK (wthout including any OpenCV header) following this example https://gist.github.com/gnuanu/252fd406f48f7da2c1c7.
There is a post here Android.mk: how to include ffmpeg and Opencv, but it has not answers and I can't solve with the info...