android +opencv问题 大神速进!

目的是要在android app中不用到opencv manager;
但是用cygwin编译时碰到问题(好几页错误,都是这一类型的)
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:32: error: undefined reference to 'cv::threshold(cv::_InputArr
ay const&, cv::_OutputArray const&, double, double, int)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:34: error: undefined reference to 'cv::_InputArray::_InputArra
y(cv::Mat const&)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:34: error: undefined reference to 'cv::resize(cv::_InputArray
const&, cv::_OutputArray const&, cv::Size_, double, double, int)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:40: error: undefined reference to 'cv::bilateralFilter(cv::_In
putArray const&, cv::_OutputArray const&, int, double, double, int)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:41: error: undefined reference to 'cv::bilateralFilter(cv::_In
putArray const&, cv::_OutputArray const&, int, double, double, int)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:44: error: undefined reference to 'cv::resize(cv::_InputArray
const&, cv::_OutputArray const&, cv::Size_, double, double, int)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:46: error: undefined reference to 'cv::_InputArray::_InputArra
y(double const&)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/opencv2/core/core.hpp:1778: error: undefined reference to 'cv::noArray()'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:46: error: undefined reference to 'cv::Mat::setTo(cv::_InputAr
ray const&, cv::_InputArray const&)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/Cartoon.o: in function image_proc(cv::Mat
):jni/Cartoon.cpp:49: error: undefined reference to 'cv::Mat::copyTo(cv::_Output
Array const&, cv::_InputArray const&) const'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/ImageProc.o: in function cv::Mat::Mat(cv:
:Mat const&):jni/opencv2/core/mat.hpp:125: error: undefined reference to 'cv::Ma
t::copySize(cv::Mat const&)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/ImageProc.o: in function Java_com_example
_cartoonfiy_ImageProc_CartoonProc:jni/ImageProc.cpp:20: error: undefined referen
ce to 'cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../l
ib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: .
/obj/local/armeabi-v7a/objs/ProcessImg/ImageProc.o: in function Java_com_example
_cartoonfiy_ImageProc_CartoonProc:jni/ImageProc.cpp:23: error: undefined referen
ce to 'cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libProcessImg.so] Error 1

以下是android.mk代码:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

OpenCV_INSTALL_MODULES:=on
OPENCV_CAMERA_MODULES:=off

OPENCV_LIB_TYPE:=STATIC

ifeq ("$(wildcard $(OPENCV_MK_PATH))","%")
include E:\OpenCV-2.4.10-android-sdk\sdk\native\jni\OpenCV.mk
else

include $(OPENCV_MK_PATH)

endif

LOCAL_MODULE := ProcessImg
LOCAL_SRC_FILES :=Cartoon.cpp\
ImageProc.cpp
LOCAL_LDLIBS += -lm -llog

include $(BUILD_SHARED_LIBRARY)

1个回答

首先检查下include和lib路径对不对。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问