I want to cross compile a project which I compiled on raspberry directly so far. I worked through some tutorials, created my raspi sysroot dir and my toolchain file and started compiling some dependent projects. Everything compiles fine up to the project containing Qt5. The problem I run into is involving the Qt tools for moc generation called by
set(CMAKE_AUTOMOC ON)
which calls rcc and
qt5_wrap_cpp(HDR_MOC ${H_FILES})
which calls moc.
The error message I get is
error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
The path to rcc and moc points to the raspi sysroot executables, which I think should be correct. I checked for zlib and it exists on my host and in the sysroot as well. My host is running Ubuntu 18.0 and tried comiling with both lib64z1, lib64z1-dev and lib32z1, lib32z1-dev installed an always get the same error.
I searched the internet but to my surprise I found nothing related. Maybe I am missing something really obvious.
Any help is highly appreciated.