我在使用 CMake 时遇到了一些问题。当我尝试为 Visual Studio 2019 配置构建时,它显示错误。当我检查 CMakeLists.txt 时,一切看起来都很好,但仍然有问题。该文件是由 Qt 自动创建的,我只是添加了一些东西来连接一些目录。我可以做什么来解决这个问题?
这是错误:
Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
The CXX compiler identification is MSVC 19.28.29334.0
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: D:/VS/VS-IDE/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:27 (find_package):
Could not find a package configuration file provided by "QT" with any of
the following names:
Qt6Config.cmake …Run Code Online (Sandbox Code Playgroud) 我需要使用 CMakeLists.txt 将预构建的“.a”静态库链接到 Android Studio 项目。
.a 库正确构建为armeabi、armeabiv-7a、mips 和x86(甚至可以“objdumped”进行“内容检查”),“.h”文件也恰到好处。
目标不是将库源代码与我的 Android Studio 项目本机源代码一起重新编译。
另外,请不要参考使用 NDK + Andoid.mk(仅限 CMakeLists.txt)的解决方案。
由于网络上没有关于此问题的有效示例(包括 Google NDK 文档和 SO),因此请提供项目文件和/或项目结构所需的所有更改。
我将“.a”文件及其“include”目录保留在本地文件夹中,因此作为对此位置的元引用,请考虑 /lib.a 和 /include。
谢谢。