hidden symbol '__aeabi_atexit' in ... is referenced by DSO ...
Hello everyone!
I'm getting the following linker warning when calling ndk-build for every (full, i.e. non-incremental) compile of android projects that are using OpenCV. I'm on Win7 x64, with Eclipse and ndk-r8e. This happens both in Eclipse and on the command line.
"E:\\Programming\\Libraries\\android-ndk-r8e\\ndk-build.cmd" all
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi-v7a/gdbserver
Gdbsetup : libs/armeabi-v7a/gdb.setup
"Compile++ thumb : CamAnalysis <= CamAnalysis.cpp
SharedLibrary : libCamAnalysis.so
E:/Programming/Libraries/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/
windows-x86_64/arm-linux-androideabi/bin/ld.exe:
warning: hidden symbol '__aeabi_atexit' in E:/Programming/Libraries/android-ndk-r8e/sources/
cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a(atexit_arm.o) is referenced by DSO
E:/Programming\Libraries\OpenCV-2.4.5-android-sdk\sdk/native/libs/armeabi-v7a/libopencv_java.so
Install : libCamAnalysis.so => libs/armeabi-v7a/libCamAnalysis.so
just for readability: the warning message without the absolute paths
ld.exe: warning: hidden symbol '__aeabi_atexit' in
libgnustl_static.a(atexit_arm.o) is referenced by DSO libopencv_java.so
Everything seems to work fine as far as I can tell, but so far I haven't even managed to find out if this might become a serious problem or can safely be ignored. This happens with every Android project containing OpenCV and native code, including the samples like "tutorial 2 mixed processing" and "face-detection". Obviously, if I change the corresponding APP_ABI inf jni/Application.mk to "armeabi" the warning is gone. Likewise, switching to static linking with "OPENCV_LIB_TYPE:=STATIC" also seems to get rid of the warning.
Please also note the additional double quotes in that message in front of Compile++ (which is also always included in the output and not a copy-paste-error on my part). I know it's likely unrelated and just a small script display/output issue, but I thought I'd mention it...
Anyone have any idea of how to fix this, like with a compiler/linker flag or something? Maybe I've got a problem in my libopencv_java library somehow? Could it be related to some order in which includes are listed? I've also fond this unanswered question relating to the same problem. Generally, whatever I try to google about this or similar warnings mostly leads to people either asking about this warning or unrelated questions that happens to contain this warning (like this or this).
Also for completeness sake, here are my JNI related files (but as I said happens with the samples as well):
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(OPENCV_ANDROID)sdk/native/jni/OpenCV.mk
LOCAL_MODULE := CamAnalysis
LOCAL_SRC_FILES := CamAnalysis.cpp
LOCAL_LDLIBS += -llog
include $(BUILD_SHARED_LIBRARY)
Application.mk
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-11
Thank you for any help!
I too am experiencing this. Any help would be welcomed!
You were able to find where is the problem?
I wasn't until just now, see my own answer below.
The
"
beforeCompile++ thumb
is a cosmetic bug in NDK specific to Windows, it is caused by difference inecho
behavior in Windows and POSIX systems.