Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling with Android NDK fails to resolve gsl #58

Open
rockaport opened this issue Feb 9, 2022 · 2 comments
Open

Compiling with Android NDK fails to resolve gsl #58

rockaport opened this issue Feb 9, 2022 · 2 comments
Labels

Comments

@rockaport
Copy link

The Android NDK is kind of funky. While it does have std::span, its version header doesn't include the __cpp_lib_span feature test macro and compilation fails to resolve gsl in defining the template in uuid.h.

include/uuid.h:52:17: error: use of undeclared identifier 'gsl'

I think this is all that's needed to fix the issue in uuid.h

#ifndef __cpp_lib_span
#include <gsl/gsl>
#endif

It also looks like even though this cmake option is default OFF, the gsl header is never being included.
option(UUID_USING_CXX20_SPAN "Using span from std instead of gsl" OFF)

@mariusbancila
Copy link
Owner

I don't have an Android NDK. Have you tried your fix? If so, can you do a PR?

UX3D-kanzler added a commit to ux3d/stduuid that referenced this issue Mar 16, 2022
@masoud-al
Copy link

I can confirm that by defining __cpp_lib_span manually and using c++20 uuid.h compiles without any modification. I tested on NDK version 25.2.9519653.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants