You are viewing an article about an obsolete product. Information on this page is provided as-is and not supported.

DEL: xconfig fail due to wrong moc installation (needs Qt3 instead of Qt4)

Digi Embedded Linux (DEL) graphical project or kernel configuration fails with:
make -k xconfig
HOSTCXX scripts/kconfig/qconf.o
make: ***[xconfig] Error 2
Sometimes you see more details, e.g.:

make -k xconfig
  CHECK   qt
sed < /usr/local/DigiEL-5.9/scripts/scripts/kconfig/lkc_proto.h > scripts/kconfig/lkc_defs.h 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
  HOSTCC  scripts/kconfig/kconfig_load.o
/usr/bin/moc -i /usr/local/DigiEL-5.9/scripts/scripts/kconfig/qconf.h -o scripts/kconfig/qconf.moc
  HOSTCXX scripts/kconfig/qconf.o
make: *** [xconfig] Error 2

or:
make xconfig
  HOSTCC  scripts/basic/fixdep
..
  HOSTCXX scripts/kconfig/qconf.o
In file included from scripts/kconfig/qconf.cc:31:0:
scripts/kconfig/qconf.moc:11:2: error: #error "The header file 'qconf.h' doesn't include <QObject>."
scripts/kconfig/qconf.moc:18:1: error: ‘QT_BEGIN_MOC_NAMESPACE’ no ..
scripts/kconfig/qconf.moc:59:63: error: ‘QMetaObject::Call’ no ..
scripts/kconfig/qconf.moc:59:90: error: no .


Those kinds of failures point to a wrong version of the moc (Qt Meta Object Compiler) for your host=development PC. Digi has tested (and delivers Kubuntu) with:

# moc -v
Qt Meta Object Compiler version 26 (Qt 3.3.8b)
# which moc
/usr/bin/moc
# ls -la /usr/bin/moc
 /usr/bin/moc->/etc/alternatives/moc
# ls -la /etc/alternatives/moc
 /etc/alternatives/moc -> /usr/bin/moc-qt3


If you have updated to Qt 4.x you need to rollback to Qt 3:

sudo update-alternatives --config moc
[sudo] password for your username:
There are 2 choices for the alternative moc (providing /usr/bin/moc)

Selection   Path             Priority   Status
------------------------------------------------------------
  0           /usr/bin/moc-qt4  40      automode
* 1           /usr/bin/moc-qt3  10      manual mode
  2           /usr/bin/moc-qt4  40      manual mode

Press enter to keep the current choice[*], or type selection number: 1


If up/downgrading to a matching Qt version fails, you may fallback to run the non-graphical menu driver configuration with:

make -k menuconfig

from you local project directory $WORKSPACE/$PROJECT/

You should disable automatic Kubuntu updates to avoid similar packages or newer versions getting installed and breaking functionality within Digi ESP.

Last updated: Jan 11, 2024

Recently Viewed

No recently viewed articles

Did you find this article helpful?