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

Bug: Build failed in Android #42

Closed
813ethan opened this issue Jul 10, 2024 · 2 comments
Closed

Bug: Build failed in Android #42

813ethan opened this issue Jul 10, 2024 · 2 comments
Assignees
Labels
C-C++ Code - Pull requests that update C++ code. C-CMake Code - Pull requests that update CMake files. T-Bug Type - Bug and unexpected behavior. W-Critical Warning - Critical
Milestone

Comments

@813ethan
Copy link
Collaborator

Describe the bug

build failed with multiple errors in Android Termux v0.119.0-beta.1

log produced:

[0/1] Re-running CMake...
-- Building for Android.
-- Configuring done (0.2s)
-- Generating done (0.1s)
-- Build files have been written to: /data/data/com.termux/files/home/storage/projects/cpp/Steppable/build
[2/117] Building CXX objec...les/util.dir/symbols.cpp.o
FAILED: src/CMakeFiles/util.dir/symbols.cpp.o
/data/data/com.termux/files/usr/bin/c++ -DLINUX -I/data/data/com.termux/files/home/storage/projects/cpp/Steppable/include -O2 -g -DNDEBUG -std=c++20 -fPIC -MD -MT src/CMakeFiles/util.dir/symbols.cpp.o -MF src/CMakeFiles/util.dir/symbols.cpp.o.d -o src/CMakeFiles/util.dir/symbols.cpp.o -c /data/data/com.termux/files/home/storage/projects/cpp/Steppable/src/symbols.cpp
/data/data/com.termux/files/home/storage/projects/cpp/Steppable/src/symbols.cpp:128:40: error: redefinition of 'SUPERSCRIPTS' with a different type: 'const std::array<std::string, 10> &' (aka 'const array<basic_string<char>, 10> &') vs 'const std::array<const std::string_view &, 10> &' (aka 'const array<const basic_string_view<char> &, 10> &')
  128 |     const std::array<std::string, 10>& SUPERSCRIPTS = { "\u2070", "\u00b9", "\u00b2", "\u00b3", "\u2074",
      |                                        ^
/data/data/com.termux/files/home/storage/projects/cpp/Steppable/include/symbols.hpp:194:59: note: previous declaration is here
  194 |     extern const std::array<const std::string_view&, 10>& SUPERSCRIPTS;
      |                                                           ^
In file included from /data/data/com.termux/files/home/storage/projects/cpp/Steppable/src/symbols.cpp:23:
In file included from /data/data/com.termux/files/home/storage/projects/cpp/Steppable/include/symbols.hpp:35:
/data/data/com.termux/files/usr/include/c++/v1/array:157:23: error: 'iterator' declared as a pointer to a reference of type 'value_type' (aka 'const std::string_view &')
  157 |     typedef value_type*                           iterator;
      |                       ^
/data/data/com.termux/files/home/storage/projects/cpp/Steppable/src/symbols.cpp:146:35: note: in instantiation of template class 'std::array<const std::string_view &, 10>' requested here
  146 |                 ss << SUPERSCRIPTS.at(c - '0');
      |                                   ^
In file included from /data/data/com.termux/files/home/storage/projects/cpp/Steppable/src/symbols.cpp:23:
In file included from /data/data/com.termux/files/home/storage/projects/cpp/Steppable/include/symbols.hpp:35:
/data/data/com.termux/files/usr/include/c++/v1/array:158:29: error: 'const_iterator' declared as a pointer to a reference of type 'value_type' (aka 'const std::string_view &')
  158 |     typedef const value_type*                     const_iterator;
      |                             ^
/data/data/com.termux/files/usr/include/c++/v1/array:159:23: error: 'pointer' declared as a pointer to a reference of type 'value_type' (aka 'const std::string_view &')
  159 |     typedef value_type*                           pointer;
      |                       ^
/data/data/com.termux/files/usr/include/c++/v1/array:160:29: error: 'const_pointer' declared as a pointer to a reference of type 'value_type' (aka 'const std::string_view &')                                                    160 |     typedef const value_type*                     const_pointer;
      |                             ^                   /data/data/com.termux/files/usr/include/c++/v1/array:166:17: error: '__elems_' declared as array of references of type 'const std::string_view &'                         166 |     _Tp __elems_[_Size];
      |                 ^
/data/data/com.termux/files/usr/include/c++/v1/array:247:15: error: 'data' declared as a pointer to a reference of type 'value_type' (aka 'const std::string_view &')
  247 |     value_type* data() _NOEXCEPT {return __elems_;}
      |               ^
/data/data/com.termux/files/usr/include/c++/v1/array:249:21: error: 'data' declared as a pointer to a reference of type 'value_type' (aka 'const std::string_view &')
  249 |     const value_type* data() const _NOEXCEPT {return __elems_;}
      |                     ^                           /data/data/com.termux/files/home/storage/projects/cpp/Steppable/src/symbols.cpp:158:16: error: no viable conversion from returned value of type 'const std::string_view' to function return type 'std::string' (aka 'basic_string<char>')
  158 |         return SUPERSCRIPTS.at(normal - '0');
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/c++/v1/string:849:55: note: candidate constructor not viable: no known conversion from 'const std::string_view' to 'string &&' for 1st argument                                           849 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(basic_string&& __str)
      |                                                       ^            ~~~~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/c++/v1/string:879:55: note: candidate constructor template not viable: no known conversion from 'const std::string_view' to 'const char *' for 1st argument
  879 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s)
      |                                                       ^            ~~~~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/c++/v1/string:994:55: note: candidate constructor not viable: no known conversion from 'const std::string_view' to 'initializer_list<char>' for 1st argument
  994 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(initializer_list<_CharT> __il)
      |                                                       ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        /data/data/com.termux/files/usr/include/c++/v1/string:2144:44: note: candidate constructor not viable: no known conversion from 'const std::string_view' to 'const string &' for 1st argument
  845 | basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)                            |                                            ^
/data/data/com.termux/files/usr/include/c++/v1/string:834:64: note: explicit constructor is not a candidate
  834 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const allocator_type& __a)
      |                                                                ^
/data/data/com.termux/files/usr/include/c++/v1/string:969:93: note: explicit constructor is not a candidate
  969 |   _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
      |                                                                                             ^
9 errors generated.
[10/117] Building CXX obje...es/util.dir/argParse.cpp.o
ninja: build stopped: subcommand failed.

To Reproduce

compiler: clang 18.1.8
build command in latest develop branch:
/data/data/com.termux/files/usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S/data/data/com.termux/files/home/storage/projects/cpp/Steppable -B/data/data/com.termux/files/home/storage/projects/cpp/Steppable/build -G Ninja

Expected behavior

The project should be built without errors

OS

  • Termux v0.119.0-beta.1
  • Android 14 QPR3
@813ethan 813ethan added the T-Bug Type - Bug and unexpected behavior. label Jul 10, 2024
@ZCG-coder
Copy link
Owner

ZCG-coder commented Jul 11, 2024 via email

@ZCG-coder ZCG-coder added C-C++ Code - Pull requests that update C++ code. C-CMake Code - Pull requests that update CMake files. W-Critical Warning - Critical labels Jul 11, 2024
@ZCG-coder ZCG-coder added this to the First Release milestone Jul 11, 2024
@813ethan
Copy link
Collaborator Author

working

@ZCG-coder ZCG-coder changed the title [Bug] : Build failed in Android Bug: Build failed in Android Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-C++ Code - Pull requests that update C++ code. C-CMake Code - Pull requests that update CMake files. T-Bug Type - Bug and unexpected behavior. W-Critical Warning - Critical
Projects
Status: Done
Development

No branches or pull requests

2 participants