How could I get rid of linking error with built static opencv lib on Android building environment?

asked 2014-09-08 21:28:01 -0600

Hi, Sir: We apply opencv2.1 to be our image algorithm lib base. And, we can built out static libs from the source code. However, we always get link error below when we want to have our shared lib with built static opencv libs.


ndk/sources/cxx-stl/stlport/stlport/stl/_alloc.h:343: error: undefined reference to 'std::bad_alloc::bad_alloc()' ndk/sources/cxx-stl/stlport/stlport/stl/_alloc.h:343: error: undefined reference to 'std::bad_alloc::bad_alloc()' ndk/sources/cxx-stl/stlport/stlport/stl/_alloc.h:343: error: undefined reference to 'std::bad_alloc::bad_alloc()' ndk/sources/cxx-stl/stlport/stlport/stl/_alloc.h:343: error: undefined reference to 'std::bad_alloc::bad_alloc()'


I show part of my Android.mk below. (PS: we don't use Application.mk due to we don't apply ndk-build directly)

---------- My own Android.mk LOCAL_CFLAGS := -O3 LOCAL_CPPFLAGS := -O3 -fexceptions -frtti

LOCAL_SRC_FILES:= \ libbokeh/inhousefft.cpp \ libbokeh/inhouse.cpp \

LOCAL_SHARED_LIBRARIES := \ libcutils \ libjpeg \ libgnustl_shared \ libstlport_shared \

LOCAL_LDFLAGS += -ldl

LOCAL_STATIC_LIBRARIES := \ libcxcore_i \ libcxcv_i \ libcxaux_i \ libcxhighui_i \ liblapack_i \


Please help me solve this problem.

Appreciations!!

Pico

edit retag flag offensive close merge delete

Comments

1

opencv2.1 is dead. don't use it.

(unfortunately, this makes your question irrelevant, too)

berak gravatar imageberak ( 2014-09-09 01:59:10 -0600 )edit