0

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.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • "The path to rcc and moc points to the raspi sysroot executables, which I think should be correct." - When cross-compile, tools involved during the build process should be from the **host** machine, not from the *target* ones. Do you have `rcc` and `moc` on the **host** (Ununtu)? – Tsyvarev Sep 12 '19 at 14:14
  • Thanks a lot Tsyvarev. This pointed me in the right direction. CMake insisted to use the rootfs binaries until I finally found this: https://stackoverflow.com/questions/39075040/cmake-cmake-automoc-in-cross-compilation. Now the mocs are generated, but I get errors when compiling the mocs. Seems to be a Qt version conflict, but I am one step further, so thanks for that. – AltruisticDelay Sep 13 '19 at 09:44

0 Answers0