英文:
C++20 standard library on Android? std::source_location support
问题
我在Android support in log4cplus中遇到了问题。在MSVC和Ubuntu上的GCC和Clang中,我可以使用std::source_location
。但是Android NDK,尽管它使用Clang 14,似乎缺少这个功能。是否有一些变量可以用来启用它,或者在CMake Android构建中使用符合C++20标准的C++库?请参阅GitHub操作描述 https://github.com/wilx/log4cplus/actions/runs/4213340922/workflow。
英文:
I have an issue with Android support in log4cplus. I can use std::source_location
in MSVC and in both GCC and Clang on Ubuntu. But the Android NDK, while it uses Clang 14, seems to lack that. Is there some variable I can use to enable it or C++20 conforming standard C++ library in CMake Android build? See https://github.com/wilx/log4cplus/actions/runs/4213340922/workflow for the GitHub action descriptor.
答案1
得分: 2
Libc++ 仅从 LLVM/Clang 版本 16 开始支持 std::source_location
,请参见 https://libcxx.llvm.org/Status/Cxx20.html,据我所知,目前没有任何 Android NDK 支持它。
在 Ubuntu 上,你可能在使用 Clang 时使用的是 libstdc++,这是标准库的另一个实现(GCC 的一部分)。
英文:
Libc++ only supports std::source_location
starting with LLVM/Clang version 16, see https://libcxx.llvm.org/Status/Cxx20.html, which as far as I can tell means that at the moment no Android NDK supports it.
On Ubuntu you are probably using libstdc++ with Clang, which is a separate implementation of the standard library (part of GCC).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论