I'm trying to build qtandroidextras from git, but having errors like droidactivityresultreceiver.o:qandroidactivityresultreceiver.cpp:function QAndroidActivityResultReceiver::QAndroidActivityResultReceiver(): error: undefined reference to 'QtAndroidPrivate::registerActivityResultListener(QtAndroidPrivate::ActivityResultListener*)' I think the issue is /private part libraries is missing from QtCore package. Here is ebuild (rather dirty) I've created to build the library. EAPI=6 QT5_MODULE="qtandroidextras" inherit qt5-build DESCRIPTION="Provides platform-specific APIs for Android" if [[ ${QT5_BUILD_TYPE} == release ]]; then KEYWORDS="amd64 arm ~arm64 ~hppa ppc64 x86" fi RDEPEND=" >=virtual/jdk-1.7 ~dev-qt/qtcore-${PV} " DEPEND="${RDEPEND}" QT5_TARGET_SUBDIRS=( src/androidextras ) pkg_setup() { export CXXFLAGS="$CXXFLAGS -I/etc/java-config-2/current-system-vm/include -I/etc/java-config-2/current-system-vm/include/linux" } Reproducible: Always Steps to Reproduce: 1. Put ebuild to /usr/portage/dev-qt/qtandroidextras/qtandroidextras-5.7.1.ebuild 2. ebuild qtandroidextras-5.7.1.ebuild manifest clean merge Actual Results: Having linking error Expected Results: qtandroidextras should be merged dev-qt/qtcore-5.7.1-r3:5/5.7::gentoo USE="icu -debug -systemd {-test}"
You can't expect to be able to build qtandroidextras against a qtcore built for linux. You need to do a custom build of qtcore for android, and then build qtandroidextras against that.
(In reply to Davide Pesavento from comment #1) > You can't expect to be able to build qtandroidextras against a qtcore built > for linux. > > You need to do a custom build of qtcore for android, and then build > qtandroidextras against that. It doesn't make sense. 1. I have functions definitions in header files, so the object file should have such functions. 2. qtandroidextras is not android version of Qt, it's the set of tools to develop Qt/Android on Linux.
(In reply to Alex Tsokurov from comment #2) > 1. I have functions definitions in header files, so the object file should > have such functions. Not necessarily. The header declaring that function is supposed to be included only `#if defined(Q_OS_ANDROID)`, which is false on linux. Also, src/corelib/kernel/kernel.pri has: android { SOURCES += \ kernel/qjnionload.cpp \ kernel/qjnihelpers.cpp \ kernel/qjni.cpp HEADERS += \ kernel/qjnihelpers_p.h \ kernel/qjni_p.h } So again, they're not built on linux. > 2. qtandroidextras is not android version of Qt, it's the set of tools to > develop Qt/Android on Linux. Yep, but you need to have a version of Qt built for your target platform (i.e. android) somewhere.