Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
None
-
6.3.2
-
None
Description
Be sure to have libEGL.so installed on the host before configuring the project. On debian it is provided by libegl-dev
Try to configure the androidnotifier example
/usr/aarch64-linux-gnu/qt-android-6.3-arm64-v8a/bin/qt-cmake -DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT -DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT ../../qtbase/examples/corelib/platform/androidnotifier
It will fail with
-- Could NOT find GLESv2 (missing: HAVE_GLESv2 HAVE_GLESv2) CMake Warning at /usr/share/cmake-3.24/Modules/CMakeFindDependencyMacro.cmake:47 (find_package): Found package configuration file: /usr/lib/aarch64-linux-gnu/qt-android-6.3-arm64-v8a/cmake/Qt6Gui/Qt6GuiConfig.cmake but it set Qt6Gui_FOUND to FALSE so package "Qt6Gui" is considered to be NOT FOUND. Reason given by package: Qt6Gui could not be found because dependency GLESv2 could not be found.
CMakeError.log says:
Performing C++ SOURCE FILE Test HAVE_EGL failed with the following output: Change Dir: /mnt/packages/git_repos/dpkg/qt-android/debian/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_c101b/fast && /usr/bin/gmake -f CMakeFiles/cmTC_c101b.dir/build.make CMakeFiles/cmTC_c101b.dir/build gmake[1]: Entering directory '/mnt/packages/git_repos/dpkg/qt-android/debian/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_c101b.dir/src.cxx.o /opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --gcc-toolchain=/opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DHAVE_EGL -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fPIE -MD -MT CMakeFiles/cmTC_c101b.dir/src.cxx.o -MF CMakeFiles/cmTC_c101b.dir/src.cxx.o.d -o CMakeFiles/cmTC_c101b.dir/src.cxx.o -c /mnt/packages/git_repos/dpkg/qt-android/debian/build/CMakeFiles/CMakeTmp/src.cxx Linking CXX executable cmTC_c101b /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c101b.dir/link.txt --verbose=1 /opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --gcc-toolchain=/opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections CMakeFiles/cmTC_c101b.dir/src.cxx.o -o cmTC_c101b /usr/lib/x86_64-linux-gnu/libEGL.so -latomic -lm ld: error: /usr/lib/x86_64-linux-gnu/libEGL.so is incompatible with aarch64linux clang++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[1]: *** [CMakeFiles/cmTC_c101b.dir/build.make:101: cmTC_c101b] Error 1 gmake[1]: Leaving directory '/mnt/packages/git_repos/dpkg/qt-android/debian/build/CMakeFiles/CMakeTmp' gmake: *** [Makefile:127: cmTC_c101b/fast] Error 2 Source file was: #include <EGL/egl.h> int main(int, char **) { EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0; eglDestroyContext(dpy, ctx); } Performing C++ SOURCE FILE Test HAVE_GLESv2 failed with the following output: Change Dir: /mnt/packages/git_repos/dpkg/qt-android/debian/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_1ff21/fast && /usr/bin/gmake -f CMakeFiles/cmTC_1ff21.dir/build.make CMakeFiles/cmTC_1ff21.dir/build gmake[1]: Entering directory '/mnt/packages/git_repos/dpkg/qt-android/debian/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_1ff21.dir/src.cxx.o /opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --gcc-toolchain=/opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DHAVE_GLESv2 -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fPIE -MD -MT CMakeFiles/cmTC_1ff21.dir/src.cxx.o -MF CMakeFiles/cmTC_1ff21.dir/src.cxx.o.d -o CMakeFiles/cmTC_1ff21.dir/src.cxx.o -c /mnt/packages/git_repos/dpkg/qt-android/debian/build/CMakeFiles/CMakeTmp/src.cxx Linking CXX executable cmTC_1ff21 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1ff21.dir/link.txt --verbose=1 /opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --gcc-toolchain=/opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections CMakeFiles/cmTC_1ff21.dir/src.cxx.o -o cmTC_1ff21 /opt/android-sdk/ndk/android-ndk-r23c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/23/libGLESv2.so /usr/lib/x86_64-linux-gnu/libEGL.so -latomic -lm ld: error: /usr/lib/x86_64-linux-gnu/libEGL.so is incompatible with aarch64linux clang++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[1]: *** [CMakeFiles/cmTC_1ff21.dir/build.make:102: cmTC_1ff21] Error 1 gmake[1]: Leaving directory '/mnt/packages/git_repos/dpkg/qt-android/debian/build/CMakeFiles/CMakeTmp' gmake: *** [Makefile:127: cmTC_1ff21/fast] Error 2 Source file was: #ifdef __APPLE__ # include <OpenGLES/ES2/gl.h> #else # define GL_GLEXT_PROTOTYPES # include <GLES2/gl2.h> #endif int main(int, char **) { glUniform1f(1, GLfloat(1.0)); glClear(GL_COLOR_BUFFER_BIT); }
In cause, probably this "/usr/lib/x86_64-linux-gnu/libEGL.so"
If I uninstall the packaged that provides /usr/lib/x86_64-linux-gnu/libEGL.so on my system (libegl-dev), there is no problem anymore.
So it seems the build system tries to use the host lib instead of the the one of the Android NDK.