Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Can't get QT5 to build for Android on my Windows 7 machine
QtWS25 Last Chance

Can't get QT5 to build for Android on my Windows 7 machine

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 3 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pjfry
    wrote on 24 Jan 2015, 12:52 last edited by
    #1

    My computer is i5 64 bit processor, running a 32 bit Windows 7.
    I use cygwin as terminal, however I have also used windows terminal with same result. I use strawberry perl 5.8 as mentioned in the link i share.

    My android is latest, so android api is "android-23".

    I followed the instructions given in this page: http://qt-project.org/wiki/building_qt-android_on_windows , and the page linked from it. So I got the qt5 source by the following way:

    git clone git://gitorious.org/qt/qt5.git qt5
    cd qt5
    perl init-repository

    Then I run configure as mentioned there, by giving it the path to Android ndk etc.

    configure runs ok. It creates the makefile, which gives the first error as:

    Can't open perl script "'C:\android\cleanqt5\qtbase\bin\syncqt.pl'": Invalid argument

    So apparently, some internal script was calling perl by surrounding the filename with quotes. I had to edit the file

    mkspecs/features/qt_module_headers.prf

    and replace ' with nothing in the path that is passed to the perl.

    After this change, it goes fine.

    After that, I get into a lot of errors of form where there are #include directives of the following form

    #include <QMutex>

    there is no .h mentioned there. So I now have to edit the source files, and add a .h to every file that is complaining about it. 42 files later, I got to build qtbase/src/corelib

    after that, I am now stuck in qtbase/src/network

    There are a log of files here which mention directories "private" and "QtNetwork", but these directories are not present in the source tree at all. For example, this file : https://qt.gitorious.org/qt/qt/source/dde0c2f4f6d72bcc9db732eb51399395ffc37778:src/network/socket/qabstractsocketengine_p.h#L86

    mentions
    #include "QtNetwork/qhostaddress.h"

    but I can't find QtNetwork folder anywhere. qhostaddress.h would be found somewhere else, so now I have to edit this file, and dozens others.

    What am I doing wrong, or is this the way to build QT5 so that I can make android apps on my win32 computer?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 24 Jan 2015, 22:52 last edited by
      #2

      Hi and welcome to devnet,

      AFAIK, you need perl 5.14 or newer to build Qt from sources and you installed 5.8. The rest of the problem is probably related to that since you are missing the auto-generated header which is a step that's done using perl.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pjfry
        wrote on 25 Jan 2015, 02:43 last edited by
        #3

        Sorry, I just checked again, that my perl is 5.20. "This is perl 5, version 20, subversion 1 (v5.20.1) built for MSWin32-x86-multi-thread-64int"

        I actually didn't need to build the QT, I now found out, cause I just installed it from qt-project site. However, I still wonder what's wrong with this build procedure, because I did just what's written on that page afaik.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 25 Jan 2015, 21:09 last edited by
          #4

          I can't tell, except that there's something fishy going on with perl as it seems. Since version 16 is the minimal version, I'd first check with that one.

          On a side note, it's Qt. QT stands for Apple QuickTime that you might also use

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AmirKh
            wrote on 6 Feb 2015, 16:33 last edited by
            #5

            Hi SGaist,

            Is there any other way rather than (http://qt-project.org/wiki/building_qt-android_on_windows) for developing Qt project on Android devices? I am new to Qt. I have finished a project using Qt 5.0.2 on my desktop computer and wanted to have an android app for my project. I have tried the above link but got all types of errors! I have also found that there is a tool called Neccessitas which is the android port of Qt4. Is there anything similar to Neccessitas for Qt 5 too? In another word, my question is that what is the simplest way of porting an existing Qt 5 project to Android?

            Thanks in advance

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 6 Feb 2015, 21:25 last edited by
              #6

              Hi,

              No need for Necessitas with Qt 5 although the Ministro service can be used.

              The simplest way is to download the pre-built package for your OS. You should grab the latest (5.4 at this time)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved