qmake and linking against Android zlib
-
Hi,
What a statement I have to put in qmake to link against
/system/libs/libz.so
for 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 += -lz
should be enough if zlib is Androïd standard library.
-
Not that easy,
LIBS += -lz
doesn'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-Lsomewhere
has to prelude-lz
-
I found the solution:
My project was already linked with
zlib
and probably all Qt Android projects are,
so the statementLIBS += -lz
is not necessary at all.I was trying to compile
minizip
library (part of zlib project) but Android doesn't supportfopen64
.
The solution was to addUSE_FILE32API
to definitions to sayminizip
not to use that.
Adding to my qmake:DEFINES += USE_FILE32API
solved linking errors.