2015-08-03 100 views
2

所以我已經試過這個link在android studio中設置openCV和NDK。但是當我試圖調試應用程序時,出現錯誤在Android Studio中找不到OpenCV

Note: C:\Users\Jeems\Documents\pulse-android1\pulseandroid\src\main\java\org\opencv\android\MyJavaCameraView.java uses or overrides a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 
:pulseandroid:compileDebugNdk 
In file included from C:\Users\Jeems\Documents\pulse-android1\pulseandroid\src\main\jni\EvmGdownIIR.cpp:1:0: 
C:\Users\Jeems\Documents\pulse-android1\pulseandroid\src\main\jni\EvmGdownIIR.hpp:4:33: fatal error: opencv2/core/core.hpp: No such file or directory 
#include <opencv2/core/core.hpp> 
           ^
compilation terminated. 
make.exe: *** [C:\Users\Jeems\Documents\pulse-android1\pulseandroid\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/pulse/C_\Users\Jeems\Documents\pulse-android1\pulseandroid\src\main\jni\EvmGdownIIR.o] Error 1 
Error:Execution failed for task ':pulseandroid:compileDebugNdk'. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Jeems\Documents\android-ndk-r10e\ndk-build.cmd'' finished with non-zero exit value 2 

而且我不能在我的項目中包含opencv2。

enter image description here

所以我錯過了哪一步?

所以,我一直在工作,直到這個新的錯誤出現。

:pulseandroid:ndkBuild 
SharedLibrary : libpulse.so 
C:/Users/Jeems/Documents/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: build/intermediates/ndk/obj/local/armeabi/objs/pulse/pt_fraunhofer_pulse_Pulse_Face.o: in function i::Java_pt_fraunhofer_pulse_Pulse_00024Face(double):src/main/jni/pt_fraunhofer_pulse_Pulse_Face.cpp:24: error: undefined reference to '__android_log_print' 
C:/Users/Jeems/Documents/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: build/intermediates/ndk/obj/local/armeabi/objs/pulse/pt_fraunhofer_pulse_Pulse_Face.o: in function i::Java_pt_fraunhofer_pulse_Pulse_00024Face(double):src/main/jni/pt_fraunhofer_pulse_Pulse_Face.cpp:42: error: undefined reference to '__android_log_print' 
C:/Users/Jeems/Documents/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: build/intermediates/ndk/obj/local/armeabi/objs/pulse/pt_fraunhofer_pulse_Pulse_Face.o: in function Java_pt_fraunhofer_pulse_Pulse_00024Face__1box:src/main/jni/pt_fraunhofer_pulse_Pulse_Face.cpp:54: error: undefined reference to '__android_log_print' 
C:/Users/Jeems/Documents/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: build/intermediates/ndk/obj/local/armeabi/objs/pulse/pt_fraunhofer_pulse_Pulse_Face.o: in function Java_pt_fraunhofer_pulse_Pulse_00024Face__1box:src/main/jni/pt_fraunhofer_pulse_Pulse_Face.cpp:74: error: undefined reference to '__android_log_print' 
collect2: ld returned 1 exit status 
make: *** [build/intermediates/ndk/obj/local/armeabi/libpulse.so] Error 1 
:pulseandroid:ndkBuild FAILED 
Error:Execution failed for task ':pulseandroid:ndkBuild'. 
> Process 'command 'C:\Users\Jeems\Documents\android-ndk-r8d\ndk-build.cmd'' finished with non-zero exit value 2 

回答

0

檢查您的openCV環境變量的包含路徑,並將其添加到系統路徑,如果您不添加。

+0

我已添加opencv路徑,現在顯示新錯誤 –

+0

檢查此鏈接(http://stackoverflow.com/questions/4455941/undefined-reference-to-android-log-print) –