Cross Compile Qt 5.7 with -qt-xcb
-
FIrst I used the method commonly but it always tell the app could not run on rpi3
then I found this link
https://forum.qt.io/topic/58772/cross-compile-qt-app-wont-open/8
add -qt-xcb , so there could be
./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/opt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -force-debug-info -make libs -make tools -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi -qt-xcbbut when it came to make, not make -j4 or else,
it went wrong with the following:rm -f libQt5Gui.so.5.7.1 libQt5Gui.so libQt5Gui.so.5 libQt5Gui.so.5.7
/home/admin/opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/admin/opt/rasp-pi-rootfs/opt/vc/lib -Wl,-rpath-link,/home/admin/opt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/admin/opt/rasp-pi-rootfs/lib/arm-linux-gnueabihf -mfloat-abi=hard --sysroot=/home/admin/opt/rasp-pi-rootfs -Wl,--no-undefined -Wl,--version-script,QtGui.version -fuse-ld=gold -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN -shared -Wl,-soname,libQt5Gui.so.5 -o libQt5Gui.so.5.7.1 .obj/qimage_compat.o .obj/qaccessible.o .obj/qaccessiblecache.o .obj/qaccessibleobject.o .obj/qaccessibleplugin.o .obj/qplatformaccessibility.o .obj/qaccessiblebridge.o .obj/qgenericpluginfactory.o .obj/qgenericplugin.o .obj/qwindowsysteminterface.o .obj/qplatforminputcontextfactory.o .obj/qplatforminputcontextplugin.o .obj/qplatforminputcontext.o .obj/qplatformintegration.o .obj/qplatformdrag.o .obj/qplatformscreen.o .obj/qplatformintegrationfactory.o .obj/qplatformintegrationplugin.o .obj/qplatformtheme.o .obj/qplatformthemefactory.o .obj/qplatformthemeplugin.o .obj/qplatformwindow.o .obj/qplatformoffscreensurface.o .obj/qplatformcursor.o .obj/qplatformclipboard.o .obj/qplatformnativeinterface.o .obj/qsessionmanager.o .obj/qshapedpixmapdndwindow.o .obj/qsimpledrag.o .obj/qsurfaceformat.o .obj/qguiapplication.o .obj/qwindow.o .obj/qoffscreensurface.o .obj/qplatformsurface.o .obj/qsurface.o .obj/qclipboard.o .obj/qcursor.o .obj/qdrag.o .obj/qdnd.o .obj/qevent.o .obj/qinputmethod.o .obj/qkeysequence.o .obj/qkeymapper.o .obj/qpalette.o .obj/qguivariant.o .obj/qscreen.o .obj/qshortcutmap.o .obj/qstylehints.o .obj/qtouchdevice.o .obj/qplatformsharedgraphicscache.o .obj/qplatformdialoghelper.o .obj/qplatformservices.o .obj/qplatformsystemtrayicon.o .obj/qplatformsessionmanager.o .obj/qplatformmenu.o .obj/qpixelformat.o .obj/qpaintdevicewindow.o .obj/qrasterwindow.o .obj/qplatformgraphicsbuffer.o .obj/qplatformgraphicsbufferhelper.o .obj/qinputdevicemanager.o .obj/qhighdpiscaling.o .obj/qplatformopenglcontext.o .obj/qopenglcontext.o .obj/qopenglwindow.o .obj/qbitmap.o .obj/qimage.o .obj/qimage_conversions.o .obj/qimageiohandler.o .obj/qimagereader.o .obj/qimagewriter.o .obj/qpaintengine_pic.o .obj/qpicture.o .obj/qpictureformatplugin.o .obj/qpixmap.o .obj/qpixmapcache.o .obj/qplatformpixmap.o .obj/qmovie.o .obj/qpixmap_raster.o .obj/qpixmap_blitter.o .obj/qnativeimage.o .obj/qimagepixmapcleanuphooks.o .obj/qicon.o .obj/qiconloader.o .obj/qiconengine.o .obj/qiconengineplugin.o .obj/qbmphandler.o .obj/qppmhandler.o .obj/qxbmhandler.o .obj/qxpmhandler.o .obj/qpnghandler.o .obj/qfont.o .obj/qfontengine.o .obj/qfontengineglyphcache.o .obj/qfontsubset.o .obj/qfontmetrics.o .obj/qfontdatabase.o .obj/qtextengine.o .obj/qtextlayout.o .obj/qtextformat.o .obj/qtextobject.o .obj/qtextoption.o .obj/qfragmentmap.o .obj/qtextdocument.o .obj/qtextdocument_p.o .obj/qtexthtmlparser.o .obj/qabstracttextdocumentlayout.o .obj/qtextdocumentlayout.o .obj/qtextcursor.o .obj/qtextdocumentfragment.o .obj/qtextimagehandler.o .obj/qtexttable.o .obj/qtextlist.o .obj/qtextdocumentwriter.o .obj/qsyntaxhighlighter.o .obj/qcssparser.o .obj/qzip.o .obj/qtextodfwriter.o .obj/qstatictext.o .obj/qrawfont.o .obj/qglyphrun.o .obj/qdistancefield.o .obj/qfontengine_qpf2.o .obj/qplatformfontdatabase.o .obj/qharfbuzzng.o .obj/qbackingstore.o .obj/qbezier.o .obj/qblendfunctions.o .obj/qblittable.o .obj/qbrush.o .obj/qcolor.o .obj/qcolor_p.o .obj/qcompositionfunctions.o .obj/qcosmeticstroker.o .obj/qcssutil.o .obj/qdrawhelper.o .obj/qemulationpaintengine.o .obj/qgammatables.o .obj/qgrayraster.o .obj/qimagescale.o .obj/qmatrix.o .obj/qmemrotate.o .obj/qoutlinemapper.o .obj/qpagedpaintdevice.o .obj/qpagelayout.o .obj/qpagesize.o .obj/qpaintdevice.o .obj/qpaintengine.o .obj/qpaintengineex.o .obj/qpaintengine_blitter.o .obj/qpaintengine_raster.o .obj/qpainter.o .obj/qpainterpath.o .obj/qpathclipper.o .obj/qpdf.o .obj/qpdfwriter.o .obj/qpen.o .obj/qpolygon.o .obj/qrasterizer.o .obj/qregion.o .obj/qstroker.o .obj/qtextureglyphcache.o .obj/qtransform.o .obj/qplatformbackingstore.o .obj/qpathsimplifier.o .obj/qdesktopservices.o .obj/qvalidator.o .obj/qgridlayoutengine.o .obj/qabstractlayoutstyleinfo.o .obj/qlayoutpolicy.o .obj/qgenericmatrix.o .obj/qmatrix4x4.o .obj/qquaternion.o .obj/qvector2d.o .obj/qvector3d.o .obj/qvector4d.o .obj/qopengl.o .obj/qopenglfunctions.o .obj/qopenglframebufferobject.o .obj/qopenglpaintdevice.o .obj/qopenglbuffer.o .obj/qopenglshaderprogram.o .obj/qopenglgradientcache.o .obj/qopengltexturecache.o .obj/qopenglengineshadermanager.o .obj/qopengl2pexvertexarray.o .obj/qopenglpaintengine.o .obj/qopenglcustomshaderstage.o .obj/qtriangulatingstroker.o .obj/qopengltextureglyphcache.o .obj/qtriangulator.o .obj/qopenglversionfunctions.o .obj/qopenglversionfunctionsfactory.o .obj/qopenglvertexarrayobject.o .obj/qopengldebug.o .obj/qopengltextureblitter.o .obj/qopengltexture.o .obj/qopengltexturehelper.o .obj/qopenglpixeltransferoptions.o .obj/qopenglfunctions_es2.o .obj/qguivariantanimation.o .obj/qstandarditemmodel.o .obj/moc_qaccessible.o .obj/moc_qaccessiblecache_p.o .obj/moc_qaccessibleplugin.o .obj/moc_qaccessiblebridge.o .obj/moc_qgenericplugin.o .obj/moc_qplatforminputcontext.o .obj/moc_qplatforminputcontextplugin_p.o .obj/moc_qplatformintegrationplugin.o .obj/moc_qplatformthemeplugin.o .obj/moc_qplatformnativeinterface.o .obj/moc_qplatformmenu.o .obj/moc_qshapedpixmapdndwindow_p.o .obj/moc_qoffscreensurface.o .obj/moc_qclipboard.o .obj/moc_qdrag.o .obj/moc_qdnd_p.o .obj/moc_qevent.o .obj/moc_qkeysequence.o .obj/moc_qkeymapper_p.o .obj/moc_qpalette.o .obj/moc_qsessionmanager.o .obj/moc_qscreen.o .obj/moc_qstylehints.o .obj/moc_qtouchdevice.o .obj/moc_qplatformsharedgraphicscache.o .obj/moc_qplatformdialoghelper.o .obj/moc_qpaintdevicewindow.o .obj/moc_qrasterwindow.o .obj/moc_qplatformgraphicsbuffer.o .obj/moc_qinputdevicemanager_p.o .obj/moc_qopenglwindow.o .obj/moc_qimageiohandler.o .obj/moc_qpictureformatplugin.o .obj/moc_qiconengineplugin.o .obj/moc_qfont.o .obj/moc_qfontdatabase.o .obj/moc_qtextformat.o .obj/moc_qtextobject.o .obj/moc_qtextdocument.o .obj/moc_qtextimagehandler_p.o .obj/moc_qtexttable.o .obj/moc_qtextlist.o .obj/moc_qbrush.o .obj/moc_qpainter.o .obj/moc_qpdfwriter.o .obj/moc_qplatformbackingstore.o .obj/moc_qvalidator.o .obj/moc_qopenglshaderprogram.o .obj/moc_qopenglengineshadermanager_p.o .obj/moc_qopengltexture.o -L/home/admin/opt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -L/home/admin/opt/qt-everywhere-opensource-src-5.7.1/qtbase/lib -lQt5Core -lpthread -lqtpng -lharfbuzz -lz -lGLESv2
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231: error: undefined reference to 'QCoreApplication::notifyInternal2(QObject*, QEvent*)'
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231: error: undefined reference to 'QCoreApplication::notifyInternal2(QObject*, QEvent*)'
../../include/QtCore/../../src/corelib/tools/qstring.h:996: error: undefined reference to 'QString::resize(int, QChar)'
../../include/QtCore/../../src/corelib/io/qdebug.h:397: error: undefined reference to 'qt_QMetaEnum_flagDebugOperator(QDebug&, unsigned int, int)'
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234: error: undefined reference to 'QCoreApplication::notifyInternal2(QObject*, QEvent*)'
../../include/QtCore/../../src/corelib/tools/qstring.h:996: error: undefined reference to 'QString::resize(int, QChar)'
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231: error: undefined reference to 'QCoreApplication::notifyInternal2(QObject*, QEvent*)'
kernel/qguiapplication.cpp:1297: error: undefined reference to 'QCoreApplicationPrivate::init()'
kernel/qclipboard.cpp:274: error: undefined reference to 'QString::operator=(QLatin1String)'
image/qimagewriter.cpp:857: error: undefined reference to 'QJsonObject::value(QLatin1String) const'
image/qimagewriter.cpp:858: error: undefined reference to 'QJsonObject::value(QLatin1String) const'
image/qimagewriter.cpp:859: error: undefined reference to 'QJsonObject::value(QLatin1String) const'
image/qimagewriter.cpp:863: error: undefined reference to 'QJsonValue::toString() const'
image/qimagewriter.cpp:864: error: undefined reference to 'QJsonValue::toString() const'
../../include/QtCore/../../src/corelib/tools/qstring.h:996: error: undefined reference to 'QString::resize(int, QChar)'
../../include/QtCore/../../src/corelib/tools/qstring.h:996: error: undefined reference to 'QString::resize(int, QChar)'
text/qfontsubset.cpp:1255: error: undefined reference to 'QString::operator=(QLatin1String)'
text/qfontsubset.cpp:1257: error: undefined reference to 'QString::operator=(QLatin1String)'
text/qfontsubset.cpp:1258: error: undefined reference to 'QString::operator=(QLatin1String)'
../../include/QtCore/../../src/corelib/io/qdatastream.h:208: error: undefined reference to 'QIODevice::isTransactionStarted() const'
../../include/QtGui/5.7.1/QtGui/private/../../../../../src/gui/text/qfragmentmap_p.h:258: error: undefined reference to 'qCalculateGrowingBlockSize(unsigned int, unsigned int, unsigned int)'
../../include/QtGui/5.7.1/QtGui/private/../../../../../src/gui/text/qfragmentmap_p.h:258: error: undefined reference to 'qCalculateGrowingBlockSize(unsigned int, unsigned int, unsigned int)'
../../include/QtCore/../../src/corelib/io/qdatastream.h:208: error: undefined reference to 'QIODevice::isTransactionStarted() const'
../../include/QtCore/../../src/corelib/io/qdatastream.h:208: error: undefined reference to 'QIODevice::isTransactionStarted() const'
../../include/QtCore/../../src/corelib/io/qdatastream.h:208: error: undefined reference to 'QIODevice::isTransactionStarted() const'
util/qvalidator.cpp:672: error: undefined reference to 'QLocaleData::validateChars(QString const&, QLocaleData::NumberMode, QByteArray*, int, QFlagsQLocale::NumberOption) const'
util/qvalidator.cpp:409: error: undefined reference to 'QLocaleData::validateChars(QString const&, QLocaleData::NumberMode, QByteArray*, int, QFlagsQLocale::NumberOption) const'
util/qvalidator.cpp:449: error: undefined reference to 'QLocaleData::validateChars(QString const&, QLocaleData::NumberMode, QByteArray*, int, QFlagsQLocale::NumberOption) const'
util/qvalidator.cpp:672: error: undefined reference to 'QLocaleData::validateChars(QString const&, QLocaleData::NumberMode, QByteArray*, int, QFlagsQLocale::NumberOption) const'
opengl/qopengl.cpp:203: error: undefined reference to 'QJsonObject::value(QLatin1String) const'
opengl/qopengl.cpp:203: error: undefined reference to 'QJsonValue::toString() const'
opengl/qopengl.cpp:204: error: undefined reference to 'QJsonValue::toString() const'
opengl/qopengl.cpp:338: error: undefined reference to 'QJsonObject::contains(QLatin1String) const'
itemmodels/qstandarditemmodel.cpp:346: error: undefined reference to 'QAbstractItemModelPrivate::~QAbstractItemModelPrivate()'
itemmodels/qstandarditemmodel.cpp:333: error: undefined reference to 'QAbstractItemModelPrivate::QAbstractItemModelPrivate()'
itemmodels/qstandarditemmodel.cpp:314: error: undefined reference to 'QAbstractItemModelPrivate::invalidatePersistentIndex(QModelIndex const&)'
itemmodels/qstandarditemmodel.cpp:306: error: undefined reference to 'QAbstractItemModelPrivate::invalidatePersistentIndex(QModelIndex const&)'
itemmodels/qstandarditemmodel.cpp:333: error: undefined reference to 'QAbstractItemModelPrivate::QAbstractItemModelPrivate()'
itemmodels/qstandarditemmodel.cpp:306: error: undefined reference to 'QAbstractItemModelPrivate::invalidatePersistentIndex(QModelIndex const&)'
itemmodels/qstandarditemmodel.cpp:333: error: undefined reference to 'QAbstractItemModelPrivate::QAbstractItemModelPrivate()'
collect2: error: ld returned 1 exit status
Makefile:1113: recipe for target '../../lib/libQt5Gui.so.5.7.1' failed
make[2]: *** [../../lib/libQt5Gui.so.5.7.1] Error 1
make[2]: Leaving directory '/home/admin/opt/qt-everywhere-opensource-src-5.7.1/qtbase/src/gui'
Makefile:471: recipe for target 'sub-gui-make_first' failed
make[1]: *** [sub-gui-make_first] Error 2
make[1]: Leaving directory '/home/admin/opt/qt-everywhere-opensource-src-5.7.1/qtbase/src'
Makefile:46: recipe for target 'sub-src-make_first' failed
make: *** [sub-src-make_first] Error 2So any one could give some help to solve it?
Thanks!