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

android: Fix build with NDK 26 #674

Merged
merged 1 commit into from Nov 27, 2023
Merged

android: Fix build with NDK 26 #674

merged 1 commit into from Nov 27, 2023

Conversation

michaelweghorn
Copy link
Contributor

While the workarounds added in

commit df0b9213017a136bf7253ea1d4aba5677c52d45c
Author: axxel <awagger@gmail.com>
Date:   Thu Dec 15 20:43:48 2022 +0100

    android: work around limitations of c++-20 support in NDK

may be necessary for NDK 25, they are no longer for NDK 26, and even break the build with NDK 26:

C/C++: .../zxing-cpp/core/src/Generator.h:103:7: error: reference to 'default_sentinel_t' is ambiguous
C/C++:         std::default_sentinel_t end() { return {}; }
C/C++:              ^
C/C++: .../Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__iterator/default_sentinel.h:23:8: note: candidate found by name lookup is 'std::__ndk1::default_sentinel_t'
C/C++: struct default_sentinel_t { };
C/C++:        ^
C/C++: .../zxing-cpp/core/src/Generator.h:15:9: note: candidate found by name lookup is 'std::default_sentinel_t'
C/C++:         struct default_sentinel_t {};
C/C++:                ^
C/C++: 2 errors generated.

Restrict the workaround to NDK version < 26 to fix this.

Fixes: #673

While the workarounds added in

    commit df0b921
    Author: axxel <awagger@gmail.com>
    Date:   Thu Dec 15 20:43:48 2022 +0100

        android: work around limitations of c++-20 support in NDK

may be necessary for NDK 25, they are no longer for NDK 26,
and even break the build with NDK 26:

    C/C++: .../zxing-cpp/core/src/Generator.h:103:7: error: reference to 'default_sentinel_t' is ambiguous
    C/C++:         std::default_sentinel_t end() { return {}; }
    C/C++:              ^
    C/C++: .../Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__iterator/default_sentinel.h:23:8: note: candidate found by name lookup is 'std::__ndk1::default_sentinel_t'
    C/C++: struct default_sentinel_t { };
    C/C++:        ^
    C/C++: .../zxing-cpp/core/src/Generator.h:15:9: note: candidate found by name lookup is 'std::default_sentinel_t'
    C/C++:         struct default_sentinel_t {};
    C/C++:                ^
    C/C++: 2 errors generated.

Restrict the workaround to NDK version < 26 to fix this.

Fixes: #673
@axxel axxel merged commit 2d5dad0 into zxing-cpp:master Nov 27, 2023
10 checks passed
@michaelweghorn michaelweghorn deleted the michaelweghorn/android_fix_ndk26_build branch November 27, 2023 15:29
tdf-gerrit pushed a commit to LibreOffice/core that referenced this pull request Nov 28, 2023
Upstream issue/PR/commit:
zxing-cpp/zxing-cpp#673
zxing-cpp/zxing-cpp#674
zxing-cpp/zxing-cpp@295b193

Change-Id: I47586e0e54b3661e4ca1b5c071f6595fd000cc70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159999
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android build fails with NDK 26
2 participants