Qt5.14编译错误-QXcbKeyboard::possibleKeys(QKeyEvent const*) const

发布于 24 天前  169 次阅读


源码编译报错

.obj/qxcbkeyboard.o:在函数‘QXcbKeyboard::possibleKeys(QKeyEvent const*) const’中:
/home/zhangpf/QtVersion/qt-everywhere-src-5.14.0/qtbase/src/plugins/platforms/xcb/qxcbkeyboard.cpp:428:对‘QXkbCommon::possibleKeys(xkb_state*, QKeyEvent const*, bool, bool)’未定义的引用
.obj/qxcbkeyboard.o:在函数‘QXcbKeyboard::initialize()’中:
/home/zhangpf/QtVersion/qt-everywhere-src-5.14.0/qtbase/src/plugins/platforms/xcb/qxcbkeyboard.cpp:571:对‘QXkbCommon::setXkbContext(QPlatformInputContext*, xkb_context*)’未定义的引用
.obj/qxcbkeyboard.o:在函数‘QXcbKeyboard::updateKeymap()’中:
/home/zhangpf/QtVersion/qt-everywhere-src-5.14.0/qtbase/src/plugins/platforms/xcb/qxcbkeyboard.cpp:423:对‘QXkbCommon::verifyHasLatinLayout(xkb_keymap*)’未定义的引用
.obj/qxcbkeyboard.o:在函数‘QXcbKeyboard::handleKeyEvent(unsigned int, QEvent::Type, unsigned char, unsigned short, unsigned int, bool)’中:
/home/zhangpf/QtVersion/qt-everywhere-src-5.14.0/qtbase/src/plugins/platforms/xcb/qxcbkeyboard.cpp:915:对‘QXkbCommon::lookupString(xkb_state*, unsigned int)’未定义的引用
/home/zhangpf/QtVersion/qt-everywhere-src-5.14.0/qtbase/src/plugins/platforms/xcb/qxcbkeyboard.cpp:921:对‘QXkbCommon::keysymToQtKey(unsigned int, QFlags<Qt::KeyboardModifier>, xkb_state*, unsigned int, bool, bool)’未定义的引用
collect2: error: ld returned 1 exit status

解决方案

编译的时候加上-qt-xcb就可以了
参考我的configure

./configure -prefix /home/zhangpf/QtVersion/build_qt5.14 -debug -opensource -confirm-license -no-openssl -no-opengl -qt-xcb -skip qtquickcontrols -skip qtquickcontrols2 -skip qtsensors -skip qtdoc -no-compile-examples

公交车司机终于在众人的指责中将座位让给了老太太