Building the android app with library fails in QtCreator/Windows



  • I try to create qtquick extention and app which uses it. The project root folder is: f:/work/app-project. There is all.pro file in that folder:

    @TEMPLATE = subdirs

    SUBDIRS +=
    app
    ext

    ext.subdir = ext
    app.depends = ext
    @

    When I try to build and deploy project to my android device and I have got an errors:
    @
    Starting: "D:\Qt\Tools\mingw482_32\bin\mingw32-make.exe" INSTALL_ROOT="F:/work/app-project/build-app-Android_for_armeabi_GCC_4_8_Qt_5_3_1Debug/android-build" install
    cd ext/ && ( test -e Makefile || D:/Qt/5.3/android_armv5/bin/qmake.exe F:/work/app-project/app/ext/ext.pro -spec android-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug -o Makefile ) && D:/Qt/Tools/mingw482_32/bin/mingw32-make -f Makefile install
    mingw32-make[1]: Entering directory 'f:/work/app-project/build-app-Android_for_armeabi_GCC_4_8_Qt_5_3_1-Debug/ext'
    /usr/bin/sh: D:MinGWmsys1.0workapp-projectbuild-app-Android_for_armeabi_GCC_4_8_Qt_5_3_1-Debugandroid-build/libs/armeabi/: No such file or directory
    /usr/bin/sh: D:MinGWmsys1.0workapp-projectbuild-app-Android_for_armeabi_GCC_4_8_Qt_5_3_1-Debugandroid-build/libs/armeabi/: No such file or directory
    @

    It seems like path passed to MSYS contains MS slashes - '', and MSYS simple eats them. How I can correct this?

    I think this situation can be corrected in way to change msys shell commands to Windows native shell commands - copy, mkdir, etc. How I can configure qtCreator/qmake to use windows native shell?



  • This problem was inspired by MSYS installed on my PC, and path to MSYS bin directory specified in system variable %PATH%.

    QMake script in spec_pre.prf:
    @
    equals(QMAKE_HOST.os, Windows) {
    QMAKE_EXT_OBJ = .obj
    QMAKE_EXT_RES = .res
    QMAKE_SH =
    PATH = $$(PATH)
    PATH = $$split(PATH, ;)
    for(dir, PATH) {
    exists($$dir/sh.exe) {
    QMAKE_SH = $$dir/sh.exe
    break()
    }
    }
    unset(PATH)
    } else {
    QMAKE_EXT_CPP += .C
    QMAKE_EXT_H += .H
    QMAKE_EXT_OBJ = .o
    QMAKE_SH = sh
    }@

    finds executable SH.EXE and uses it. Removing MSYS from %PATH% solves problem.

    New problem is:

    Tryinig to make project causes calling mingw32-make and the something test. I find such prormam in MSYS, but I can't understand, what it do. Try test -h, test --help, test -h, test /h and so on does nothing.



  • I wrote test.bat which solveng problem:
    @
    echo off
    rem test -d file - 0 if file or dir exist
    rem test -e file - 0 if file exist

    if "%1"=="-d" goto lblchkdir
    if "%1"=="-e" goto lblchkfile
    goto end

    :lblchkdir
    if exist %2% (
    exit /b 0
    )
    goto end
    :lblchkfile
    if exist %2% (
    exit /b 0
    )
    :end
    exit /b 1
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.