Unsolved Qt with ARM Cross compiler propblem
-
Dear all,
I use the Qt to build a simple project. my environment is listed as below- ubuntu version: 14.04 (ubuntu-14.04.5-desktop-amd64.iso)
- cross-compiler toolchain : arm-linux-gnueabihf-g++-4.8
- Qt creator: 4.0.2 based on Qt 5.7.0
- Qt library : 5.6
my purpose is to build this project and run the executable file on Nvidia TK1.
The Qt reports the error message as below, It looks likes the syntax probelms,But I don't know why.
Is anyone able to give me some suggestions? Thanks a lot.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 -
Presumably the compiler you are using is too old. AFAIK you would need a gcc version 4.9 or higher for the newer Qt versions. Qt 5.6 and already Qt 5.4 has been shipped with MinGW (gcc) 4.9 already.
You are using a cross-compiler based on gcc 4.8. I suspect that there might be the reason for your problems. I would go back to earlier Qt version and see if you compile it through then.
Hope that helps.
-
update information:
-
I could use the linux x86 g++ (gcc version is 4.8.4) to compile this project successfully.
-
I have installed another Qt version (5.6.2), it is still fail with arm-linux-gnueabihf-g++-4.8
-
-
update information :
-
Qt 5.7.0 (qt-opensource-linux-x64-5.7.0.run, Qt creator 4.0.2) with Qt 5.6.0 package is built for ARM platform (use it's qmake) and arm-linux-gnueabihf-g++-4.9 on ubuntu 15.04
=>Fail ,the same problem -
Qt 5.6.0 (qt-opensource-linux-x64-5.6.0.run, Qt creator 3.6.1) with Qt 5.6.0 package is built for ARM platform (use it's qmake) and arm-linux-gnueabihf-g++-4.8 on ubuntu 14.04.5 =>Fail, the same problem
-
-
Just for clarification, there is no need to install a complete version of Qt libs and a creator version for your task.
Qt creator is "simply" an IDE and is managing the qmake, make, and compilation stuff for you. You can use the newest version Qt creator with any Qt lib version on your desktop without problem. Qt creator is an IDE based on Qt libs and you have to ensure that the proper version of Qt libs are installed together with creator.
Qt libs and the compiler, it was created, with are building a kit (or sometiem referred as tool chain) which may be chosen within Qt creator for building projects. You can install a couple of different kits in parallel and switch between them within Qt creator. You can download different versions from the archives and install them in parallel.
When Qt creator and Qt libs are released closely together they refere to the version number for Qt libs, but these is no need. The Qt libs for operation of creator are installed separately. This may leed to some duplication, but should impose a problem nowadays.
When you are cross-compiling you have simply another kit. You could simply download an archive and a config batch was associated with it. After starting the config the configuration was handled and only the make process was started in addition.
You can download the code from git here for different versions. I was trying to find the older style with the zip- and tar-files, but those are apparently no longer supported.At least in the past it was always recommended to download a fresh code archive for compilation with different (cross-)compilers. Especially the sources delivered with pre-compiled Qt libs were not fit for another compilation run. I need to check on this.
-