請問使用ARM cross-compiler with Qt on Ubuntu



  • 各位前輩,
    我打算在ubuntu of PC上使用Qt,加上ARM toolchian去compile project.目前遭遇一個問題,看起來像是語法問題,但我不知道為什麼,同樣的 project,我用linux x86 g++就可以正常,請問有人看過這個error message (Note)嗎?
    我的環境如下:
    1.ubuntu version: 14.04 (ubuntu-14.04.5-desktop-amd64.iso)
    2.cross-compiler toolchain : arm-linux-gnueabihf-g++-4.8
    3.Qt creator: 4.0.2 based on Qt 5.7.0
    4.Qt library : 5.6

    Note:
    arm-linux-gnueabihf-g++ -c -pipe -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -D__ARM__ -DDEBUG_MODE -DQT_QML_DEBUG -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I../SMPCodeReader1 -I. -I/usr/local/jetsonTK1_qt56/armlibTK/usr/include -I/usr/local/jetsonTK1_qt56/armlibTK/usr/include/qt5/QtCore -I../SMPCodeReader1/src/barcodeLib/softek -I../SMPCodeReader1/src/uEye/armhf -I/usr/local/jetsonTK1_qt56/include -I/usr/local/jetsonTK1_qt56/include/QtMultimedia -I/usr/local/jetsonTK1_qt56/include/QtWidgets -I/usr/local/jetsonTK1_qt56/include/QtGui -I/usr/local/jetsonTK1_qt56/include/QtNetwork -I/usr/local/jetsonTK1_qt56/include/QtCore -I. -I. -I/usr/local/jetsonTK1_qt56/mkspecs/linux-arm-gnueabi-g++ -o cammgr.o ../SMPCodeReader1/cammgr.cpp
    In file included from /usr/local/jetsonTK1_qt56/include/QtGui/qcolor.h:39:0,
    from /usr/local/jetsonTK1_qt56/include/QtGui/qimage.h:37,
    from /usr/local/jetsonTK1_qt56/include/QtGui/QImage:1,
    from ../SMPCodeReader1/abstractcamdev.h:6,
    from ../SMPCodeReader1/cammgr.h:5,
    from ../SMPCodeReader1/cammgr.cpp:1:
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:57:20: error: 'QListSpecialMethods' is not a class template
    template <> struct QListSpecialMethods<QString>
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:59:1: error: explicit specialization of non-template 'QListSpecialMethods'
    {
    ^
    In file included from /usr/local/jetsonTK1_qt56/include/QtGui/qcolor.h:39:0,
    from /usr/local/jetsonTK1_qt56/include/QtGui/qimage.h:37,
    from /usr/local/jetsonTK1_qt56/include/QtGui/QImage:1,
    from ../SMPCodeReader1/abstractcamdev.h:6,
    from ../SMPCodeReader1/cammgr.h:5,
    from ../SMPCodeReader1/cammgr.cpp:1:
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:145:40: error: expected initializer before '<' token
    inline QStringList *QListSpecialMethods<QString>::self()
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:147:46: error: expected initializer before '<' token
    inline const QStringList *QListSpecialMethods<QString>::self() const
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:180:32: error: expected initializer before '<' token
    inline void QListSpecialMethods<QString>::sort(Qt::CaseSensitivity cs)
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:185:31: error: expected initializer before '<' token
    inline int QListSpecialMethods<QString>::removeDuplicates()
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:190:35: error: expected initializer before '<' token
    inline QString QListSpecialMethods<QString>::join(const QString &sep) const
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:195:35: error: expected initializer before '<' token
    inline QString QListSpecialMethods<QString>::join(QChar sep) const
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:200:39: error: expected initializer before '<' token
    inline QStringList QListSpecialMethods<QString>::filter(const QString &str, Qt::CaseSensitivity cs) const
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:210:40: error: expected initializer before '<' token
    inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:224:40: error: expected initializer before '<' token
    inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QRegExp &rx, const QString &after)
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:230:39: error: expected initializer before '<' token
    inline QStringList QListSpecialMethods<QString>::filter(const QRegExp &rx) const
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:258:40: error: expected initializer before '<' token
    inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QRegularExpression &rx, const QString &after)
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qstringlist.h:264:39: error: expected initializer before '<' token
    inline QStringList QListSpecialMethods<QString>::filter(const QRegularExpression &rx) const
    ^
    In file included from /usr/local/jetsonTK1_qt56/include/QtCore/qvariant.h:47:0,
    from /usr/local/jetsonTK1_qt56/include/QtMultimedia/qvideoframe.h:41,
    from /usr/local/jetsonTK1_qt56/include/QtMultimedia/QVideoFrame:1,
    from ../SMPCodeReader1/abstractcamdev.h:7,
    from ../SMPCodeReader1/cammgr.h:5,
    from ../SMPCodeReader1/cammgr.cpp:1:
    /usr/local/jetsonTK1_qt56/include/QtCore/qbytearraylist.h:55:20: error: 'QListSpecialMethods' is not a class template
    template <> struct QListSpecialMethods<QByteArray>
    ^
    /usr/local/jetsonTK1_qt56/include/QtCore/qbytearraylist.h:55:50: error: 'QListSpecialMethods' is not a template type
    template <> struct QListSpecialMethods<QByteArray>
    ^
    make: *** [cammgr.o] Error 1



  • @b108463 Hi, friend, welcome.

    怎么错误都来自QStringList这个Core类呢. 错误描述好像是模板类的方法用错误了. 具体的我也不知道.



  • 查看Qt是否支持这个类别的嵌入式平台。接着就是查看configure阶段是否满足一些依赖。否则的话,只能手动添加依赖了。另外,还可以修改源代码,或者对Qt进行裁剪。剔除不需要的编译部分。


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.