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.
-
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$
-
Where did you download QuaZip from ?
-
Sorry, I couldn't reproduce your problem.
Which NDK are you using ? I have the r13b
-
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?
-
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 :(
-
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".
-
@CharlieG
I am currently trying to use Quazip for Android, but I cannot use Quazip in QT and I am getting an error. What I did was I installed quazip-dev for Ubuntu and referenced it to my qt project, but it does not recognize the library. How did you install Quazip and compile it for Android? Can you please help? -
@GulsahAkt said in Build QuaZip for Android Qt:
What I did was I installed quazip-dev for Ubuntu and referenced it to my qt project, but it does not recognize the library. How did you install Quazip and compile it for Android? Can you please help?
I already told you in your other thread what you need to do:
- Build QuaZip for android
- Use this build to build your app for Android
What about following this suggestion?
Installing QuZip packages for your Linux distribution will not help you because those are for your desktop Linux, not for Android...
-
@jsulm I'm very sorry, after your answer I'm looking into how to compile it for Android. I don't know what I need to do to compile for Android. I couldn't find what to do for Android from Quazip's own instructions.
I am inexperienced in this matter and unfortunately this was the only post I came across on the forum about it.