[Interest] Moc file won't compile on Android

Joshua Grauman jnfo-c at grauman.com
Fri Nov 11 20:02:47 CET 2016


Hello all,

I am working on compiling a test program for Android. It uses 
qttoolbardialog from 
Qt5.6.2-Android/5.6/Src/qttools/src/shared/qttoolbardialog. The files are 
included in the .pro file like:

SOURCES += qttoolbardialog.cpp
HEADERS += qttoolbardialog.h
FORMS += qttoolbardialog.ui
RESOURCES += qttoolbardialog.qrc

It all works fine for the desktop version(s). But when I try to compile 
the same project for Android (using Qt Creator, which works fine for other 
projects), the moc file won't compile. The compiler output is below. Does 
anyone know what is going on??

Thanks!

Josh



/opt/android-ndk-r12b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ 
-c -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp 
-mfpu=vfp -fno-builtin-memmove 
--sysroot=/opt/android-ndk-r12b/platforms/android-9/arch-arm/ -O2 -Os 
-mthumb -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DVER5 -DQT_NO_DEBUG 
-DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_XML_LIB 
-DQT_NETWORK_LIB -DQT_CORE_LIB -I../maincode-dev -I. 
-I/opt/Qt5.6.2-Android/5.6/android_armv7/include 
-I/opt/Qt5.6.2-Android/5.6/android_armv7/include/QtPrintSupport 
-I/opt/Qt5.6.2-Android/5.6/android_armv7/include/QtWidgets 
-I/opt/Qt5.6.2-Android/5.6/android_armv7/include/QtGui 
-I/opt/Qt5.6.2-Android/5.6/android_armv7/include/QtXml 
-I/opt/Qt5.6.2-Android/5.6/android_armv7/include/QtNetwork 
-I/opt/Qt5.6.2-Android/5.6/android_armv7/include/QtCore -I. -I. -isystem 
/opt/android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem 
/opt/android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include 
-isystem /opt/android-ndk-r12b/platforms/android-9/arch-arm/usr/include 
-I/opt/Qt5.6.2-Android/5.6/android_armv7/mkspecs/android-g++ -o 
moc_qttoolbardialog.o moc_qttoolbardialog.cpp
moc_qttoolbardialog.cpp: In static member function 'static void 
QtToolBarDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, 
void**)':
moc_qttoolbardialog.cpp:187:29: error: invalid use of incomplete type 
'class QtToolBarDialogPrivate'
          case 0: _t->d_func()->newClicked(); break;
                              ^
In file included from moc_qttoolbardialog.cpp:9:0:
../maincode-dev/qttoolbardialog.h:88:7: error: forward declaration of 
'class QtToolBarDialogPrivate'
  class QtToolBarDialogPrivate;
        ^
moc_qttoolbardialog.cpp:188:29: error: invalid use of incomplete type 
'class QtToolBarDialogPrivate'
          case 1: _t->d_func()->removeClicked(); break;
                              ^
In file included from moc_qttoolbardialog.cpp:9:0:
../maincode-dev/qttoolbardialog.h:88:7: error: forward declaration of 
'class QtToolBarDialogPrivate'
  class QtToolBarDialogPrivate;
        ^
moc_qttoolbardialog.cpp:189:29: error: invalid use of incomplete type 
'class QtToolBarDialogPrivate'
          case 2: _t->d_func()->defaultClicked(); break;
                              ^
In file included from moc_qttoolbardialog.cpp:9:0:
../maincode-dev/qttoolbardialog.h:88:7: error: forward declaration of 
'class QtToolBarDialogPrivate'
  class QtToolBarDialogPrivate;
        ^
moc_qttoolbardialog.cpp:190:29: error: invalid use of incomplete type 
'class QtToolBarDialogPrivate'
          case 3: _t->d_func()->okClicked(); break;



More information about the Interest mailing list