今天用lazarus 3.4在银河麒麟将应用编译为Qt5出现以下错误信息:
Warning: linker: /usr/bin/ld.bfd: /home/lb/fpcupdeluxe34/lazarus/lcl/units/aarch64-linux/qt5/qtint.o: in function `QTINT$_$TQTWIDGETSET_$__$$_CREATE$$TQTWIDGETSET': Error: qtint.pp:(.text.n_qtint$_$tqtwidgetset_$__$$_create$$tqtwidgetset+0x120): undefined reference to `QGuiApplication_setFallbackSessionManagementEnabled' Warning: linker: /usr/bin/ld.bfd: /home/lb/fpcupdeluxe34/lazarus/lcl/units/aarch64-linux/qt5/qtobjects.o: in function `QTOBJECTS$_$TQTCLIPBOARD_$__$$_ENDX11SELECTIONLOCK': Error: qtobjects.pas:(.text.n_qtobjects$_$tqtclipboard_$__$$_endx11selectionlock+0x58): undefined reference to `QTimer_singleShot3' project1.lpr(27,0) Error: Error while linking
解决方法:
很简单(不要见笑),就用早期的QT5替换lazarus 3.4的版本
旧版的QT5可以从123云盘下载后替换(/lazarus/lcl/interfaces/qt5)就可以:
https://www.123pan.com/s/6OFxjv-qBdu3?提取码:wjGr