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. QMake errors with platform-specific sections like android: and win32:
Forum Updated to NodeBB v4.3 + New Features

QMake errors with platform-specific sections like android: and win32:

Scheduled Pinned Locked Moved Solved Installation and Deployment
2 Posts 1 Posters 674 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.
  • D Offline
    D Offline
    Dmitriano
    wrote on last edited by Dmitriano
    #1

    Hello!
    Something strange happens in my PRO file. My PRO file contains the following workaround for compiling my app on Android:

    android : QT += androidextras
    {
        #QT += androidextras
    
        ANDROID_PACKAGE_SOURCE_DIR = $$PWD/platform/android
    
        android:DISTFILES += \
                $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml
    }
    

    QMake works fine with this, and the app compiles in both Android and Windows configurations, but I cannot figure out how curly braces work here, because the following still works in Android configuration, but produces QMake errors in Windows Desktop configuration:

    android
    {
        QT += androidextras
    
        ANDROID_PACKAGE_SOURCE_DIR = $$PWD/platform/android
    
        android:DISTFILES += \
                $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml
    }
    

    QMake error in Windows configuration is: Project ERROR: Unknown module(s) in QT: androidextras
    I get the same result if I add the colon after 'andorid'. Why the line 'QT += androidextras' is executed for Windows if there is a condition 'android:'? My QT version is 5.8. QMake version is 3.1. At least my syntax looks like described here http://doc.qt.io/qt-4.8/qmake-tutorial.html and here http://doc.qt.io/qt-4.8/qmake-advanced-usage.html.

    Finally I tried this:

    win32
    {
        message(Compiling on Win32 platform.)
    }
    
    android
    {
        message(Compiling on Android platform.)
    }
    

    and got the both messages all the time independently of the platform I compile for:
    Project MESSAGE: Compiling on Win32 platform.
    Project MESSAGE: Compiling on Android platform.

    D 1 Reply Last reply
    0
    • D Dmitriano

      Hello!
      Something strange happens in my PRO file. My PRO file contains the following workaround for compiling my app on Android:

      android : QT += androidextras
      {
          #QT += androidextras
      
          ANDROID_PACKAGE_SOURCE_DIR = $$PWD/platform/android
      
          android:DISTFILES += \
                  $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml
      }
      

      QMake works fine with this, and the app compiles in both Android and Windows configurations, but I cannot figure out how curly braces work here, because the following still works in Android configuration, but produces QMake errors in Windows Desktop configuration:

      android
      {
          QT += androidextras
      
          ANDROID_PACKAGE_SOURCE_DIR = $$PWD/platform/android
      
          android:DISTFILES += \
                  $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml
      }
      

      QMake error in Windows configuration is: Project ERROR: Unknown module(s) in QT: androidextras
      I get the same result if I add the colon after 'andorid'. Why the line 'QT += androidextras' is executed for Windows if there is a condition 'android:'? My QT version is 5.8. QMake version is 3.1. At least my syntax looks like described here http://doc.qt.io/qt-4.8/qmake-tutorial.html and here http://doc.qt.io/qt-4.8/qmake-advanced-usage.html.

      Finally I tried this:

      win32
      {
          message(Compiling on Win32 platform.)
      }
      
      android
      {
          message(Compiling on Android platform.)
      }
      

      and got the both messages all the time independently of the platform I compile for:
      Project MESSAGE: Compiling on Win32 platform.
      Project MESSAGE: Compiling on Android platform.

      D Offline
      D Offline
      Dmitriano
      wrote on last edited by
      #2

      figured this out, it is because the brace should be on the same line like "android {"

      1 Reply Last reply
      1

      • Login

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