qmake and linking against Android zlib
-
Hi,
What a statement I have to put in qmake to link against
/system/libs/libz.sofor any Android target?All compiles fine,
#include <zlib.h>works out of the box without any additionalINCLUDEPATH
but linking fails.
All Android docs say zlib is part of Android NDK. -
Hi,
AFAIK
LIBS += -lzshould be enough if zlib is Androïd standard library.
-
Not that easy,
LIBS += -lzdoesn't work - still the same linking error.I found that library in the location:
toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/30/
of the NDK
or actually, inside many locations with different numbers and architectures.
Probably some-Lsomewherehas to prelude-lz -
I found the solution:
My project was already linked with
zliband probably all Qt Android projects are,
so the statementLIBS += -lzis not necessary at all.I was trying to compile
miniziplibrary (part of zlib project) but Android doesn't supportfopen64.
The solution was to addUSE_FILE32APIto definitions to sayminizipnot to use that.
Adding to my qmake:DEFINES += USE_FILE32APIsolved linking errors.