[HowTo] Cross compile Qt5

Started by Cosik, October 27, 2014, 11:17:52 am

Previous topic - Next topic

Sohaib Manzoor

November 12, 2015, 02:58:18 pm #45 Last Edit: November 12, 2015, 03:00:53 pm by Sohaib Manzoor
I executed only make, as instructed in the output of ./configure. Please scroll down for the errors "make" outputs. The make command stops after those errors. Here are the errors coming before the warnings:
from qeglfsintegration.cpp:49:
../../../../include/QtCore/../../src/corelib/io/qurl.h:171:26: error: 'UrlFormattingOption' was not declared in this scope
     typedef QUrlTwoFlags<UrlFormattingOption, ComponentFormattingOption> FormattingOptions;
                          ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:171:72: error: template argument 1 is invalid
     typedef QUrlTwoFlags<UrlFormattingOption, ComponentFormattingOption> FormattingOptions;
                                                                        ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:171:91: error: invalid type in declaration before ';' token
     typedef QUrlTwoFlags<UrlFormattingOption, ComponentFormattingOption> FormattingOptions;
                                                                                           ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:174:10: error: expected unqualified-id before ')' token
     QUrl();
          ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:175:10: error: expected unqualified-id before 'const'
     QUrl(const QUrl &copy);
          ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:175:10: error: expected ')' before 'const'
../../../../include/QtCore/../../src/corelib/io/qurl.h:176:38: error: 'QUrl& operator=(const QUrl&)' must be a nonstatic member function
     QUrl &operator =(const QUrl &copy);
                                      ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:180:10: error: expected unqualified-id before 'const'
     QUrl(const QString &url, ParsingMode mode = TolerantMode);
          ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:180:10: error: expected ')' before 'const'
../../../../include/QtCore/../../src/corelib/io/qurl.h:181:39: error: 'QUrl& operator=(const QString&)' must be a nonstatic member function
     QUrl &operator=(const QString &url);
                                       ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:184:15: error: expected ')' before '&&' token
     QUrl(QUrl &&other) : d(0)
               ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:186:40: error: 'QUrl& operator=(QUrl&&)' must be a nonstatic member function
     inline QUrl &operator=(QUrl &&other)
                                        ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:189:12: error: expected constructor, destructor, or type conversion before ';' token
     ~QUrl();
            ^
../../../../include/QtCore/../../src/corelib/io/qurl.h: In function 'void swap(QUrl&)':
../../../../include/QtCore/../../src/corelib/io/qurl.h:191:43: error: 'd' was not declared in this scope
     inline void swap(QUrl &other) { qSwap(d, other.d); }
                                           ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:191:52: error: 'class QUrl' has no member named 'd'
     inline void swap(QUrl &other) { qSwap(d, other.d); }
                                                    ^
../../../../include/QtCore/../../src/corelib/io/qurl.h: At global scope:
../../../../include/QtCore/../../src/corelib/io/qurl.h:193:37: error: 'ParsingMode' has not been declared
     void setUrl(const QString &url, ParsingMode mode = TolerantMode);
                                     ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:193:56: error: 'TolerantMode' was not declared in this scope
     void setUrl(const QString &url, ParsingMode mode = TolerantMode);
                                                        ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:194:79: error: non-member function 'QString url(FormattingOptions)' cannot have cv-qualifier
     QString url(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
                                                                               ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:195:84: error: non-member function 'QString toString(FormattingOptions)' cannot have cv-qualifier
     QString toString(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
                                                                                    ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:196:91: error: non-member function 'QString toDisplayString(FormattingOptions)' cannot have cv-qualifier
     QString toDisplayString(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
                                                                                           ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:197:46: error: non-member function 'QUrl adjusted(FormattingOptions)' cannot have cv-qualifier
     QUrl adjusted(FormattingOptions options) const;
                                              ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:199:68: error: non-member function 'QByteArray toEncoded(FormattingOptions)' cannot have cv-qualifier
     QByteArray toEncoded(FormattingOptions options = FullyEncoded) const;
                                                                    ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:200:52: error: 'ParsingMode' has not been declared
     static QUrl fromEncoded(const QByteArray &url, ParsingMode mode = TolerantMode);
                                                    ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:200:71: error: 'TolerantMode' was not declared in this scope
     static QUrl fromEncoded(const QByteArray &url, ParsingMode mode = TolerantMode);
                                                                       ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:204:20: error: non-member function 'bool isValid()' cannot have cv-qualifier
     bool isValid() const;
                    ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:205:27: error: non-member function 'QString errorString()' cannot have cv-qualifier
     QString errorString() const;
                           ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:207:20: error: non-member function 'bool isEmpty()' cannot have cv-qualifier
     bool isEmpty() const;
                    ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:211:22: error: non-member function 'QString scheme()' cannot have cv-qualifier
     QString scheme() const;
                      ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:213:49: error: 'ParsingMode' has not been declared
     void setAuthority(const QString &authority, ParsingMode mode = TolerantMode);
                                                 ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:213:68: error: 'TolerantMode' was not declared in this scope
     void setAuthority(const QString &authority, ParsingMode mode = TolerantMode);
                                                                    ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:214:75: error: non-member function 'QString authority(ComponentFormattingOptions)' cannot have cv-qualifier
     QString authority(ComponentFormattingOptions options = PrettyDecoded) const;
                                                                           ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:216:47: error: 'ParsingMode' has not been declared
     void setUserInfo(const QString &userInfo, ParsingMode mode = TolerantMode);
                                               ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:216:66: error: 'TolerantMode' was not declared in this scope
     void setUserInfo(const QString &userInfo, ParsingMode mode = TolerantMode);
                                                                  ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:217:74: error: non-member function 'QString userInfo(ComponentFormattingOptions)' cannot have cv-qualifier
     QString userInfo(ComponentFormattingOptions options = PrettyDecoded) const;
                                                                          ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:219:47: error: 'ParsingMode' has not been declared
     void setUserName(const QString &userName, ParsingMode mode = DecodedMode);
                                               ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:219:66: error: 'DecodedMode' was not declared in this scope
     void setUserName(const QString &userName, ParsingMode mode = DecodedMode);
                                                                  ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:220:73: error: non-member function 'QString userName(ComponentFormattingOptions)' cannot have cv-qualifier
     QString userName(ComponentFormattingOptions options = FullyDecoded) const;
                                                                         ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:222:47: error: 'ParsingMode' has not been declared
     void setPassword(const QString &password, ParsingMode mode = DecodedMode);
                                               ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:222:66: error: 'DecodedMode' was not declared in this scope
     void setPassword(const QString &password, ParsingMode mode = DecodedMode);
                                                                  ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:223:65: error: non-member function 'QString password(ComponentFormattingOptions)' cannot have cv-qualifier
     QString password(ComponentFormattingOptions = FullyDecoded) const;
                                                                 ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:225:39: error: 'ParsingMode' has not been declared
     void setHost(const QString &host, ParsingMode mode = DecodedMode);
                                       ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:225:58: error: 'DecodedMode' was not declared in this scope
     void setHost(const QString &host, ParsingMode mode = DecodedMode);
                                                          ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:226:61: error: non-member function 'QString host(ComponentFormattingOptions)' cannot have cv-qualifier
     QString host(ComponentFormattingOptions = FullyDecoded) const;
                                                             ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:227:79: error: non-member function 'QString topLevelDomain(ComponentFormattingOptions)' cannot have cv-qualifier
     QString topLevelDomain(ComponentFormattingOptions options = FullyDecoded) const;
                                                                               ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:230:36: error: non-member function 'int port(int)' cannot have cv-qualifier
     int port(int defaultPort = -1) const;
                                    ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:232:39: error: 'ParsingMode' has not been declared
     void setPath(const QString &path, ParsingMode mode = DecodedMode);
                                       ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:232:58: error: 'DecodedMode' was not declared in this scope
     void setPath(const QString &path, ParsingMode mode = DecodedMode);
                                                          ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:233:69: error: non-member function 'QString path(ComponentFormattingOptions)' cannot have cv-qualifier
     QString path(ComponentFormattingOptions options = FullyDecoded) const;
                                                                     ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:234:73: error: non-member function 'QString fileName(ComponentFormattingOptions)' cannot have cv-qualifier
     QString fileName(ComponentFormattingOptions options = FullyDecoded) const;
                                                                         ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:236:21: error: non-member function 'bool hasQuery()' cannot have cv-qualifier
     bool hasQuery() const;
                     ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:237:41: error: 'ParsingMode' has not been declared
     void setQuery(const QString &query, ParsingMode mode = TolerantMode);
                                         ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:237:60: error: 'TolerantMode' was not declared in this scope
     void setQuery(const QString &query, ParsingMode mode = TolerantMode);
                                                            ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:239:63: error: non-member function 'QString query(ComponentFormattingOptions)' cannot have cv-qualifier
     QString query(ComponentFormattingOptions = PrettyDecoded) const;
                                                               ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:241:24: error: non-member function 'bool hasFragment()' cannot have cv-qualifier
     bool hasFragment() const;
                        ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:242:74: error: non-member function 'QString fragment(ComponentFormattingOptions)' cannot have cv-qualifier
     QString fragment(ComponentFormattingOptions options = PrettyDecoded) const;
                                                                          ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:243:47: error: 'ParsingMode' has not been declared
     void setFragment(const QString &fragment, ParsingMode mode = TolerantMode);
                                               ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:243:66: error: 'TolerantMode' was not declared in this scope
     void setFragment(const QString &fragment, ParsingMode mode = TolerantMode);
                                                                  ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:245:41: error: non-member function 'QUrl resolved(const QUrl&)' cannot have cv-qualifier
     QUrl resolved(const QUrl &relative) const;
                                         ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:247:23: error: non-member function 'bool isRelative()' cannot have cv-qualifier
     bool isRelative() const;
                       ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:248:38: error: non-member function 'bool isParentOf(const QUrl&)' cannot have cv-qualifier
     bool isParentOf(const QUrl &url) const;
                                      ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:250:24: error: non-member function 'bool isLocalFile()' cannot have cv-qualifier
     bool isLocalFile() const;
                        ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:252:27: error: non-member function 'QString toLocalFile()' cannot have cv-qualifier
     QString toLocalFile() const;
                           ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:255:23: error: non-member function 'bool isDetached()' cannot have cv-qualifier
     bool isDetached() const;
                       ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:257:38: error: non-member function 'bool operator<(const QUrl&)' cannot have cv-qualifier
     bool operator <(const QUrl &url) const;
                                      ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:257:38: error: 'bool operator<(const QUrl&)' must take exactly two arguments
../../../../include/QtCore/../../src/corelib/io/qurl.h:258:39: error: non-member function 'bool operator==(const QUrl&)' cannot have cv-qualifier
     bool operator ==(const QUrl &url) const;
                                       ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:258:39: error: 'bool operator==(const QUrl&)' must take exactly two arguments
../../../../include/QtCore/../../src/corelib/io/qurl.h:259:39: error: non-member function 'bool operator!=(const QUrl&)' cannot have cv-qualifier
     bool operator !=(const QUrl &url) const;
                                       ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:259:39: error: 'bool operator!=(const QUrl&)' must take exactly two arguments
../../../../include/QtCore/../../src/corelib/io/qurl.h:261:62: error: non-member function 'bool matches(const QUrl&, FormattingOptions)' cannot have cv-qualifier
     bool matches(const QUrl &url, FormattingOptions options) const;
                                                              ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:342:1: error: expected unqualified-id before 'private'
private:
^
../../../../include/QtCore/../../src/corelib/io/qurl.h:345:1: error: expected unqualified-id before 'public'
public:
^
../../../../include/QtCore/../../src/corelib/io/qurl.h:350:64: error: 'ParsingMode' has not been declared
     static QList<QUrl> fromStringList(const QStringList &uris, ParsingMode mode = TolerantMode);
                                                                ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:350:83: error: 'TolerantMode' was not declared in this scope
     static QList<QUrl> fromStringList(const QStringList &uris, ParsingMode mode = TolerantMode);
                                                                                   ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:353:5: error: 'friend' used outside of class
     friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed) Q_DECL_NOTHROW;
     ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:355:1: error: expected unqualified-id before 'private'
private:
^
../../../../include/QtCore/../../src/corelib/io/qurl.h:357:5: error: 'friend' used outside of class
     friend class QUrlQuery;
     ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:359:1: error: expected unqualified-id before 'public'
public:
^
../../../../include/QtCore/../../src/corelib/io/qurl.h:361:12: error: 'DataPtr' does not name a type
     inline DataPtr &data_ptr() { return d; }
            ^
../../../../include/QtCore/../../src/corelib/io/qurl.h:362:1: error: expected declaration before '}' token
};
^
../../../../include/QtCore/../../src/corelib/io/qurl.h:200:17: warning: 'QUrl fromEncoded(const QByteArray&, int)' declared 'static' but never defined [-Wunused-function]
     static QUrl fromEncoded(const QByteArray &url, ParsingMode mode = TolerantMode);


And these are the contents of qurl.h
#include "../../src/corelib/io/qurl.h"

Cosik

did you perform make always on fresh extracted Qt sources?
Did you compiled Mali drivers for yours linux?

It's a problematic for me to reproduce this because I don't have working lime.

Sohaib Manzoor

Yes I performed make on a newly extracted Qt source.
I also compiled Mali drivers for my target (Olimex A20) Linux. I ran the test which showed a colored triangle.

Okay, thanks a lot for your help. Please suggest anything that I could possibly be missing.

Sohaib Manzoor

Hi Cosik

i am  a beginner so i hope you don't mind my stupid questions .. the problem here is that i am  done with all these steps and it compiled fine now what i am supposed to do next ? Do i have to download and install a QT creator because i couldn't find it in the installed files folder?

JoseQ

Hi Cosik,
First of all, thank you for this guide, there is few documentation out there.

I'm experiencing some problems.

I'm downloading Qt-everywhere 5.5.0:
    wget http://www.mirrorservice.org/sites/download.qt-project.org/archive/qt/5.5/5.5.0/single/qt-everywhere-opensource-src-5.5.0.tar.gz

Also gitorious is going down so I'm downloading cross-compile-tools from:
    git clone https://github.com/shahriman/cross-compile-tools.git

And this Linaro toolchain:
    wget https://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.bz2

I'm woring in Ubuntu 14.04, and mounting A20 image through sshf.


The main errors I'm experiencing are on "./configure" stage, and they have to do with "determining target architecture", and with "OpenGL auto-detection":
  • Determining architecture... ()
    /home/jose/gcc-linaro-9/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a7 -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=/mnt/a20 -g -Wall -W -fPIC  -I. -I../../mkspecs/devices/linux-a20olimex-g++ -o arch.o arch.cpp
    /home/jose/gcc-linaro-9/bin/arm-linux-gnueabihf-g++  -o arch arch.o   -lrt -lpthread -ldl --sysroot=/mnt/a20
    /home/jose/gcc-linaro-9/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'
    collect2: error: ld returned 1 exit status
    make: *** [arch] Error 1
    Unable to determine architecture!

    Could not determine the target architecture!


  • OpenGL auto-detection... ()
    /home/jose/gcc-linaro-9/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mtune=cortex-a7 -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=/mnt/a20 -O2 -O3 -Wall -W -fPIC  -I. -I/mnt/a20/usr/include/GLES2 -I../../../mkspecs/devices/linux-a20olimex-g++ -o opengles2.o opengles2.cpp
    /home/jose/gcc-linaro-9/bin/arm-linux-gnueabihf-g++ -Wl,-O1 -o opengles2 opengles2.o   -lrt -lpthread -ldl --sysroot=/mnt/a20 -L/mnt/a20/usr/lib -lGLESv2 -lEGL
    /home/jose/gcc-linaro-9/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'
    collect2: error: ld returned 1 exit status
    make: *** [opengles2] Error 1
    OpenGL disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/jose/qt/qtbase/mkspecs/devices/linux-a20olimex-g++.





Right now I'm installing debian32 bit on VBox, maybe that would ease some things.


I would really appreciate your help.

Thanks