Old-Man-Programmer / tree

Tree for Unix/LInux
GNU General Public License v2.0
140 stars 31 forks source link

Add the option to cross compile for Android phones using the NDK #6

Open freemedom opened 6 months ago

freemedom commented 6 months ago

https://developer.android.com/ndk/guides/other_build_systems https://dl.google.com/android/repository/android-ndk-r26c-linux.zip

It was only tested on Ubuntu and my Android 10 phone.

freemedom commented 6 months ago
tree.c:151:16: error: call to undeclared function 'nl_langinfo'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
       (strcmp(nl_langinfo(CODESET), "UTF-8") == 0 ||
               ^
tree.c:151:16: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
       (strcmp(nl_langinfo(CODESET), "UTF-8") == 0 ||
               ^~~~~~~~~~~~~~~~~~~~

tree.c:152:16: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
        strcmp(nl_langinfo(CODESET), "utf8") == 0)) {
               ^~~~~~~~~~~~~~~~~~~~
tree.c:1032:11: error: call to undeclared function 'strverscmp'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  int v = strverscmp((*a)->name,(*b)->name);
          ^
ld.lld: error: undefined symbol: strverscmp
>>> referenced by tree.c:1032
>>>               tree.o:(versort)

ld.lld: error: undefined symbol: nl_langinfo
>>> referenced by tree.c:151
>>>               tree.o:(main)
>>> referenced by tree.c:152
>>>               tree.o:(main)
clang-17: error: linker command failed with exit code 1 (use -v to see invocation)
freemedom commented 6 months ago

To fix these errors