我正在尝试使用IntelliJ IDEA 13.1.4开发OpenCV的本机代码。当我尝试ndk构建混合处理示例中提供的代码时,我有这个错误:
[armeabi-v7a] Compile++ thumb: com_sample_jniLib <= com_sample_jniLib.cpp
[armeabi-v7a] SharedLibrary : libcom_sample_jniLib.so
D:/Workspace/android-ndk-r10/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: cannot find -lopencv_java
make.exe: *** [obj/local/armeabi-v7a/libcom_voxar_tracker_TrackerLib.so] Error 1
D:\Workspace\android-ndk-r10\sources\cxx-stl\stlport\stlport
基本上,他找不到-lopencv_java。
这是我的Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include jni/opencv/OpenCV.mk
LOCAL_SRC_FILES := com_voxar_tracker_TrackerLib.cpp
LOCAL_MODULE := com_voxar_tracker_TrackerLib
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)
我的Application.mk:
APP_STL := stlport_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := all
正如我之前所说,我正在使用 IntelliJ IDEA 13.1.4 , OpenCV 2.4.9 和 Android NDK r10 32位在 Windows 8.1 上。有没有人知道那可能是什么?
答案 0 :(得分:4)
您似乎忘记了 Android.mk 中的OPENCV_INSTALL_MODULES:=on
:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
include jni/opencv/OpenCV.mk
LOCAL_SRC_FILES := com_voxar_tracker_TrackerLib.cpp
LOCAL_MODULE := com_voxar_tracker_TrackerLib
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)