Android NDK clang 编译器错误在 Windows 上显示'No such file or directory'
Android NDK clang compiler error showing 'No such file or directory' on Windows
我正在尝试学习如何使用 ndk r21 将 c/c++ 本机代码与 android 一起使用。我将我的 C++ cmake 文件链接到我的 android 项目中,并在生成 cpp 共享库文件。但是,我收到如下编译器错误:-
C/C++ 配置问题 托卡 |调试 |x86 编译器退出,错误代码为 1:C:\Users\ASUS\AppData\Local\Android\Sdkdk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe -xc++ --target=i686-none-linux-android16 --gcc-toolchain=C:/Users/ASUS/AppData/Local/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/ASUS/AppData/Local/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DTOKA_ARCHIVE_DIR=\"。/docs/\" -DTOKA_BASE_DIR=\"../\" -DTOKA_DATABASE_DIR=\"../docs/database/\" -DTOKA_DEVELOPMENT_BUILD -DTOKA_PLUGIN_DIR=\"plugins/Debug/\" -DTOKA_SOURCE -DToka_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -D_FORTIFY_SOURCE=2 -Wformat -fexceptions -frtti/W3 -O0 -fno-limit-debug-info -fPIC -c -fpch-preprocess -v -dD -E 安卓 (5900059基于 r365631c( clang 版本 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 207d7abc...
这是我可以复制到剪贴板的错误部分。下图显示了其中一个库的完整错误。
错误消息(无法将其复制到剪贴板(
我尝试在谷歌上搜索类似的错误,但没有找到。有人说这可能是窗户上的路径长度问题。我直接在 C:\ 下复制了我的 ndk 以获得尽可能短的路径,但无济于事。我按照指南在这里为 android 工作室配置 cmake 和 ndk,但仍然收到相同的错误。我安装了更高版本的 cmake,后来我了解到它毫无用处,因为 ndk 附带了自己的 cmake 安装。我安装了较旧的 ndk r20 和 r12b,但问题仍然没有消失。事实上,r12b似乎不支持cmake。我不知道该怎么办了。我已经尝试解决这个问题 3 天了。似乎这个问题有一个明显的解决方案,我忽略了。有人可以帮我吗?谢谢。
对我来说,这是一个空格字符问题。项目文件夹(或项目名称(不应包含任何空格字符。显然,某些内部命令行不支持空格,或者缺少一些双引号。
- Android NDK clang 编译器错误在 Windows 上显示'No such file or directory'
- 已解决 - C++ 的崇高文本中的"fatal error: opencv: no such file or directory"
- "No such file or directory" C++标头问题
- 我在 #include < bits/stdc++h.> 放置时出错"No such file or directory"
- 叮叮当当。target_include_directories "No such file or directory"
- 从生成文件编译错误:"Unable to open output file" ..."No such file or directory"
- C++编译期间出现"No such file or directory"错误
- 如何修复以下错误"no match for call to '(std::tr1::shared_ptr<_iobuf*>) (FILE*&)'"
- 尝试编译 TensorFlow 时出错"/system/bin/linker: No such file or directory"
- 代码块中的哈希库++库"No such file or directory"错误
- 成功使用CMakeLists制作后如何修复"open: No such file or directory"错误(该文件实际上存在)
- 如何在安装了 WSL 的 Visual Studio Code 中修复"g++: error: helloworld.cpp: No such file or directory"?
- 尝试使用生成文件编译程序时"fatal error: boost/regex.hpp: No such file or directory" C++
- SDL 测试程序 - "No such file or directory"
- GDB 列表错误"No such file or directory"
- 我的文件可以编译,但当我尝试运行它时"no such file or directory"
- 无法使用 Qt: "No such file or directory" 打开包含文件
- 如何修复"fatal error: boost/asio.hpp: no such file or directory"?
- ": No such file or directory"执行外壳文件
- 我错过了什么吗?我一直在输出"No file found!"