Ask Your Question
1

How to enable CV_DbgAssert on Android

asked 2015-06-19 15:48:46 -0600

Oliv gravatar image

I have 5000 line algorithm and if fails with SIGSEGV on Android. I found out, that range checking is only done if _DEBUG is defined.

I my Android.mk I have LOCAL_CFLAGS := -D_DEBUG, but the debug assertions are still not executed. How to enable them? Here is my complete Android.mk file:

LOCAL_CPPFLAGS := -D_DEBUG
LOCAL_CFLAGS := -D_DEBUG

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
OPENCV_LIB_TYPE:=STATIC
include d:\OpenCV-2.4.11-android-sdk\sdk\native\jni\OpenCV.mk

LOCAL_MODULE    := recognizer
LOCAL_SRC_FILES := /* file list */
LOCAL_LDLIBS    += -llog
include $(BUILD_SHARED_LIBRARY)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-06-22 00:39:03 -0600

Oliv gravatar image

updated 2015-06-22 00:39:31 -0600

I found the solution, I needed to move the line include $(CLEAR_VARS) before the LOCAL_CFLAGS line, here is modified Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_CPPFLAGS := -D_DEBUG
LOCAL_CFLAGS := -D_DEBUG

OPENCV_LIB_TYPE:=STATIC
include d:\OpenCV-2.4.11-android-sdk\sdk\native\jni\OpenCV.mk

LOCAL_MODULE    := recognizer
LOCAL_SRC_FILES := /* file list */
LOCAL_LDLIBS    += -llog
include $(BUILD_SHARED_LIBRARY)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-06-19 15:48:46 -0600

Seen: 252 times

Last updated: Jun 22 '15