Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android build error with define
Forum Updated to NodeBB v4.3 + New Features

Android build error with define

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 503 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    MartinD
    wrote on last edited by
    #1

    Hi,
    my .pro contains:

    VERSION = 1.1.0.0
    QMAKE_TARGET_PRODUCT = "MyApp"
    QMAKE_TARGET_DESCRIPTION = ""
    QMAKE_TARGET_COMPANY = "MyCompany"
    QMAKE_TARGET_COPYRIGHT = "Copyright (c) byMyCompany"
    

    My application builds for Android armeabi-v7a (GCC 4.9, Qt 5.7.1) on Win 10.

    If I add to my pro:

    DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" \
               APP_PRODUCT=\"\\\"$${QMAKE_TARGET_PRODUCT}\\\"\" \
               APP_COMPANY=\"\\\"$${QMAKE_TARGET_COMPANY}\\\"\" \
               APP_COPYRIGHT=\"\\\"$${QMAKE_TARGET_COPYRIGHT}\\\"\"
    

    Then the app build fails on first file:

    D:\Android\ndk\android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++ -c -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove --sysroot=D:\Android\ndk\android-ndk-r11c/platforms/android-9/arch-arm/ -g -g -marm -O0 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DAPP_VERSION="\"1.1.0.0\"" -DAPP_PRODUCT="\"Break Bricks\"" -DAPP_COMPANY="\"Gradient Labs\"" -DAPP_COPYRIGHT="\"Copyright (c) by Gradient Labs\"" -DQT_QML_DEBUG -DQT_PLUGIN -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I../MyApp -I. -IC:/Qt/5.7/android_armv7/include -IC:/Qt/5.7/android_armv7/include/QtQuick -IC:/Qt/5.7/android_armv7/include/QtMultimedia -IC:/Qt/5.7/android_armv7/include/QtGui -IC:/Qt/5.7/android_armv7/include/QtQml -IC:/Qt/5.7/android_armv7/include/QtNetwork -IC:/Qt/5.7/android_armv7/include/QtSql -IC:/Qt/5.7/android_armv7/include/QtCore -I. -I../../../../Android/ndk/android-ndk-r11c/sources/cxx-stl/gnu-libstdc++/4.9/include -I../../../../Android/ndk/android-ndk-r11c/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -I../../../../Android/ndk/android-ndk-r11c/platforms/android-9/arch-arm/usr/include -IC:/Qt/5.7/android_armv7/mkspecs/android-g++ -o a.obj ../MyApp/a.cpp
    /usr/bin/sh: -c: line 0: syntax error near unexpected token `('
    

    Why and how to fix it?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You likely need to also escape the parenthesis. Otherwise you may have surprises.

      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