我是android ndk和opencv的新手 但是我已经在Eclipse中运行了一些opencv项目的示例/教程 因此opencv库应该不是问题
Here i want to run this camera project from github, i think it should work
下载后将其导入Eclipse, 我遇到了一个问题:
当我运行它时会停止并完成,因为无法在CameraActivity中加载库。
-> System.loadLibrary("PanoHDR");
我试图在网上搜索解决方案,但它们要么不起作用,要么我不理解它们。
我是否需要做类似" ndk-build"在某个地方让它发挥作用?
有人可以帮帮我吗?我找不到任何解决方案。这是默认的android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# Tegra optimized OpenCV.mk
include /Users/milmil/Documents/NVPACK/OpenCV-2.4.5-Tegra-sdk-r2/sdk/native/jni/OpenCV-tegra3.mk
# Linker
LOCAL_LDLIBS += -llog
# Our module sources
LOCAL_MODULE := PanoHDR
LOCAL_SRC_FILES := PanoHDR.cpp Panorama.cpp HDR.cpp NativeLogging.cpp
include $(BUILD_SHARED_LIBRARY)
当我尝试在项目的主目录中的cmd中使用ndk-build时 它失败了
jni/Android.mk:6: /sdk/native/jni/OpenCV.mk: No such file or directory
make: *** No rule to make target `/sdk/native/jni/OpenCV-tegra3'. Stop.
它应该是由Andriod.mk中的这一行引起的。
include /Users/milmil/Documents/NVPACK/OpenCV-2.4.5-Tegra-sdk-r2/sdk/native/jni/OpenCV-tegra3.mk
我尝试使用opencv sdk的路径
include /Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk
并在cmd中返回
Android NDK: WARNING:jni/Android.mk:PanoHDR: non-system libraries in linker flag
s: -lopencv_java3
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_S
TATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependenc
ies of the
Android NDK: current module
[armeabi-v7a] "Compile++ thumb": "PanoHDR <= PanoHDR.cpp"
The system cannot find the path specified.
make: *** [obj/local/armeabi-v7a/objs/PanoHDR/PanoHDR.o] Error 1
谢谢
=============================================== ==========================
WARNING:jni/Android.mk:PanoHDR: non-system libraries in linker flag
s: -lopencv_java3
通过在android.mk中添加"OPENCV_LIB_TYPE=STATIC"
来解决上述问题,但仍有此错误&#34;
[armeabi-v7a] "Compile++ thumb": "PanoHDR <= PanoHDR.cpp"
The system cannot find the path specified.
make: *** [obj/local/armeabi-v7a/objs/PanoHDR/PanoHDR.o] Error 1"