How to Use Qt6 libraries in android studio ndk?
Unsolved
Mobile and Embedded
-
I want to use Qt6 Core library in my android studio ndk project. Despite of many attempts I have failed. Please guide me how to use Qt6 libraries in android studio ndk project.
Qt6 installation directory: "C:\Qt"
And the path
"C:\Qt\6.4.1"
directory contains the following files and folders:14.12.2022 18:32 <DIR> . 14.12.2022 18:32 <DIR> .. 10.11.2022 18:12 <DIR> android_arm64_v8a 10.11.2022 18:16 <DIR> android_armv7 10.11.2022 18:19 <DIR> android_x86 10.11.2022 18:21 <DIR> android_x86_64 10.11.2022 17:47 <DIR> Logs 10.11.2022 16:04 <DIR> mingw_64 10.11.2022 16:33 <DIR> msvc2019_64 10.11.2022 17:11 <DIR> msvc2019_arm64 14.12.2022 18:32 0 output.txt 10.11.2022 17:47 2.084 sha1s.txt 10.11.2022 17:47 <DIR> Src 10.11.2022 18:25 <DIR> wasm_32 2 File(s) 2.084 bytes 12 Dir(s) 230.990.303.232 bytes free
Please note that it doesn't contain CMakeLists.txt.
I tried the following steps and failed at all.
Step1:
# CMakeLists.txt cmake_minimum_required(VERSION 3.21.1) project(test) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) list(APPEND CMAKE_PREFIX_PATH "C:/Qt/6.4.1") list(APPEND CMAKE_PREFIX_PATH "C:/Qt/6.4.1/mingw_64/") find_packgggage(Qt6 REQUIRED COMPONENTS Core) add_library(test-lib SHARED native-lib.cpp) target_link_libraries(test-lib Qt6::Core)
Step2:
# CMakeLists.txt cmake_minimum_required(VERSION 3.21.1) project(test) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_library(test-lib SHARED native-lib.cpp) include_directories(test-lib "C:/Qt/6.4.1/mingw_64/include") target_link_libraries(test-lib "C:/Qt/6.4.1/mingw_64/lib/libQt6Core.a" )
All the steps above failed. How to overcome this? Any helps would be very appreciated.