Build QuaZip for Android Qt



  • Hello,

    Think you is it possible to build QuaZip for Android ? I try this :
    /path/to/qmake-android/qmake PREFIX=/path/where/install -spec android-g++

    but this doesn't work.

    Here, .pro file of quazip:

    TEMPLATE = lib
    CONFIG += qt warn_on
    QT -= gui
    
    # The ABI version.
    
    !win32:VERSION = 1.0.0
    
    # 1.0.0 is the first stable ABI.
    # The next binary incompatible change will be 2.0.0 and so on.
    # The existing QuaZIP policy on changing ABI requires to bump the
    # major version of QuaZIP itself as well. Note that there may be
    # other reasons for chaging the major version of QuaZIP, so
    # in case where there is a QuaZIP major version bump but no ABI change,
    # the VERSION variable will stay the same.
    
    # For example:
    
    # QuaZIP 1.0 is released after some 0.x, keeping binary compatibility.
    # VERSION stays 1.0.0.
    # Then some binary incompatible change is introduced. QuaZIP goes up to
    # 2.0, VERSION to 2.0.0.
    # And so on.
    
    
    # This one handles dllimport/dllexport directives.
    DEFINES += QUAZIP_BUILD
    
    # You'll need to define this one manually if using a build system other
    # than qmake or using QuaZIP sources directly in your project.
    CONFIG(staticlib): DEFINES += QUAZIP_STATIC
    
    # Input
    include(quazip.pri)
    
    
    CONFIG(debug, debug|release) {
         mac: TARGET = $$join(TARGET,,,_debug) 
         win32: TARGET = $$join(TARGET,,,d)
    }
    
    unix:!symbian {
        headers.path=$$PREFIX/include/quazip
        headers.files=$$HEADERS
        target.path=$$PREFIX/lib/$${LIB_ARCH}
        INSTALLS += headers target
        LIBS += -lz
        OBJECTS_DIR=.obj
        MOC_DIR=.moc
    	
    }
    
    android {
        headers.path=$$PREFIX/include/quazip
        headers.files=$$HEADERS
        target.path=$$PREFIX/lib/$${LIB_ARCH}
        INSTALLS += headers target
        LIBS += -lz
        OBJECTS_DIR=.obj
        MOC_DIR=.moc
    }
    
    win32 {
        #TODO ....
        headers.path=$$PREFIX/include/quazip
        headers.files=$$HEADERS
        target.path=$$PREFIX/lib
        INSTALLS += headers target
        # workaround for qdatetime.h macro bug
        DEFINES += NOMINMAX
    }
    
    
    symbian {
    
        # Note, on Symbian you may run into troubles with LGPL.
        # The point is, if your application uses some version of QuaZip,
        # and a newer binary compatible version of QuaZip is released, then
        # the users of your application must be able to relink it with the
        # new QuaZip version. For example, to take advantage of some QuaZip
        # bug fixes.
    
        # This is probably best achieved by building QuaZip as a static
        # library and providing linkable object files of your application,
        # so users can relink it.
    
        CONFIG += staticlib
        CONFIG += debug_and_release
    
        LIBS += -lezip
    
        #Export headers to SDK Epoc32/include directory
        exportheaders.sources = $$HEADERS
        exportheaders.path = quazip
        for(header, exportheaders.sources) {
            BLD_INF_RULES.prj_exports += "$$header $$exportheaders.path/$$basename(header)"
        }
    }
    
    Have you an idea to fixe this issues ?
    
    Thank you for advance.
    
    ++
    
    
    Charlie.
    

  • Lifetime Qt Champion

    Hi,

    What exactly doesn't work ?



  • Hi @SGaist ,

    Ohh yes ... sorry. Here the message of terminal :

    MBPdeChrlesElie:quazip charlie$ /Applications/Qt/Qt5.8.0/5.8/android/bin/qmake -spec android-g++ PREFIX=/Applications/Qt/Qt5.8.0/5.8/android
    MBPdeChrlesElie:quazip charlie$ make
    rm -f libquazip.so
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ --sysroot=/Users/charlie/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm/ -Wl,-rpath=/Applications/Qt/Qt5.8.0/5.8/android/lib -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-soname,libquazip.so -o libquazip.so .obj/qioapi.o .obj/JlCompress.o .obj/quaadler32.o .obj/quacrc32.o .obj/quagzipfile.o .obj/quaziodevice.o .obj/quazip.o .obj/quazipdir.o .obj/quazipfile.o .obj/quazipfileinfo.o .obj/quazipnewinfo.o .obj/unzip.o .obj/zip.o .obj/moc_quagzipfile.o .obj/moc_quaziodevice.o .obj/moc_quazipfile.o  -L/Users/charlie/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/Users/charlie/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm//usr/lib -L/Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x -lz -L/Applications/Qt/Qt5.8.0/5.8/android/lib -lQt5Core -lgnustl_shared -llog -lz -lm -ldl -lc -lgcc 
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/qioapi.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/JlCompress.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quaadler32.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quacrc32.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quagzipfile.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quaziodevice.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quazip.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quazipdir.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quazipfile.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quazipfileinfo.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/quazipnewinfo.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/unzip.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/zip.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/moc_quagzipfile.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/moc_quaziodevice.o:1:1: invalid character
    /Users/charlie/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: .obj/moc_quazipfile.o:1:1: invalid character
    collect2: error: ld returned 1 exit status
    make: *** [libquazip.so] Error 1
    MBPdeChrlesElie:quazip charlie$ 
    

  • Lifetime Qt Champion

    Where did you download QuaZip from ?




  • Lifetime Qt Champion

    Sorry, I couldn't reproduce your problem.

    Which NDK are you using ? I have the r13b



  • @SGaist
    Super...

    I have just update my NDK (13.0 to 13.1) and the building works.

    Thank you very much.

    PS: mark to solved doesn't work ???



  • Re,

    So, the building works, but I have 2 problems with the library :

    • impossible to find the quazip lib in the folder : /Applications/Qt/Qt5.8.0/5.8/android
    • I have this message wher execute the code undefined reference to 'JlCompress::compressFile(QString, QString)'

    Do you have any idea about these problems?


  • Lifetime Qt Champion

    Where is the file located ?

    The second error comes from the first. If the linker can't find the library it can't link to it thus you'll have symboles missing.

    As for the "solving" part. You need to select ask as question from the "Topic Tools" button and then click on it again to mark the thread as solved.



  • @SGaist said in Build QuaZip for Android Qt:

    Where is the file located ?

    The lib ? Precisely I don't know. With the QuaZip for Mac OS, I have /Applications/Qt/Qt5.8.0/5.8/clang_64/lib/libquazip.1.0.0.dylib.
    But with QuaZip for Android, I have nothing in /Applications/Qt/Qt5.8.0/5.8/android/lib. Still, I have the headers in /Applications/Qt/Qt5.8.0/5.8/android/include

    @SGaist said in Build QuaZip for Android Qt:

    As for the "solving" part. You need to select ask as question from the "Topic Tools" button and then click on it again to mark the thread as solved.

    Yes, but here I only have two possibilities : Delete topic & Ask as question :(


  • Lifetime Qt Champion

    Did you install the library ?

    You must first click on "Ask as question" and then when you open it again you'll have the "mark as solved".



  • @SGaist
    Sorry, ... I hadn't to be awake...

    The lib is installed in / libs / armeabi-v7a. So I copied it to /Applications/Qt/Qt5.8.0/5.8/android/lib for ease.

    Thank you a lot.


Log in to reply
 

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