Build native libs for LatinIME. Error: base class ‘class latinime::NgramListener’ should be explicitly initialized in the copy constructor [-Werror=extra]

Published by Igor Khrupin on

I working on LatinIME Android Keyboard keyboard.

I’ve got source from Google repo.
Here is structure:

java – contains java code
native – jni code.

When I try to build native I receive next error:

'latinime::MultiBigramMap::BigramMap::BigramMap(const latinime::MultiBigramMap::BigramMap&)':
jni/src/suggest/core/dictionary/multi_bigram_map.h:56:9: error: base class 'class latinime::NgramListener' should be explicitly initialized in the copy constructor [-Werror=extra]

Full stacktrace:

➜ native ndk-build
[arm64-v8a] Compile++ : jni_latinime_common_static <= com_android_inputmethod_keyboard_ProximityInfo.cpp
[arm64-v8a] Compile++ : jni_latinime_common_static <= com_android_inputmethod_latin_BinaryDictionary.cpp
[arm64-v8a] Compile++ : jni_latinime_common_static <= com_android_inputmethod_latin_BinaryDictionaryUtils.cpp
[arm64-v8a] Compile++ : jni_latinime_common_static <= com_android_inputmethod_latin_DicTraverseSession.cpp
In file included from jni/src/suggest/core/session/dic_traverse_session.h:25:0,
from jni/com_android_inputmethod_latin_DicTraverseSession.cpp:24:
jni/src/suggest/core/dictionary/multi_bigram_map.h: In copy constructor 'latinime::MultiBigramMap::BigramMap::BigramMap(const latinime::MultiBigramMap::BigramMap&)':
jni/src/suggest/core/dictionary/multi_bigram_map.h:56:9: error: base class 'class latinime::NgramListener' should be explicitly initialized in the copy constructor [-Werror=extra]
BigramMap(const BigramMap &bigramMap)
^
cc1plus: all warnings being treated as errors
make: *** [obj/local/arm64-v8a/objs/jni_latinime_common_static/com_android_inputmethod_latin_DicTraverseSession.o] Error 1

To avoid it I’ve edited Android.mk in jni dir and replace:

LOCAL_CFLAGS += -Werror -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \
    -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls \
    -Woverloaded-virtual -Wsign-promo -Wno-system-headers

with

LOCAL_CFLAGS += -w

It is not remove the code problem, but you able to build .so lib


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.