-
Notifications
You must be signed in to change notification settings - Fork 74
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
Compilation fails (cdefs.h, stdio.h) #158
Comments
Try ndk r16 from this website https://chromium.googlesource.com/android_ndk/+archive/refs/heads/r16 |
Would you elaborate on your answer? What are these files? How does the NDK relate to this problem?
|
Android dropped support for gcc from ndk r18 thats why i am using a older ndk. The container compressed folders which contain header files for c and c++ and libraries . Decompress the files files using zarchiver then on termux use CD to navigate to one of the folder with c headers then go to bits and move all the files from there to $PREFIX/includes/bits then exit the bits directory then remove bits and copy all the folders and header files inside the folder to $PREFIX/includes. Repeat the steps for the second folder with c++ headers . Goto the folder containing libraries and move libgnustl_shared to $PREFIX/lib . Now you can compile c programs with gcc file.c and c++ programs with g++ file.cpp -lgnustl_shared . |
See #141 for what needs to be edited to get rid of the undefined "INTRODUCED_IN" in the standard headers |
This issue is due to failing of setup-patchforgcc script. If you run it with -v flag, you will find these errors
|
I cannot get gcc to work at all: Even if I try to compile a simple Hello World program, I get the following output:
In file included from /data/data/com.termux/files/usr/include/sys/cdefs.h:429,
from /data/data/com.termux/files/usr/include/stdio.h:41,
from hello.c:1:
/data/data/com.termux/files/usr/include/android/api-level.h:185:50: error: 'stric
t' undeclared here (not in a function)
185 | int android_get_application_target_sdk_version() __INTRODUCED_IN(24);
| ^~~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/android/api-level.h:185:50: error: 'intro
duced' undeclared here (not in a function)
185 | int android_get_application_target_sdk_version() __INTRODUCED_IN(24);
This is the output of gcc -v:
Reading specs from /data/data/com.termux/files/usr/lib/gcc/aarch64-linux-android/
11.1.0/specs
COLLECT_GCC=/data/data/com.termux/files/usr/bin/gcc
COLLECT_LTO_WRAPPER=/data/data/com.termux/files/usr/libexec/gcc/aarch64-linux-and
roid/11.1.0/lto-wrapper
Target: aarch64-linux-android
Configured with: /home/builder/.termux-build/gcc-11/src/configure --disable-depen
dency-tracking --prefix=/data/data/com.termux/files/usr --libdir=/data/data/com.t
ermux/files/usr/lib --sbindir=/data/data/com.termux/files/usr/bin --disable-rpath
--disable-rpath-hack --host=aarch64-linux-android --enable-languages=c,c++,fortr
an,jit,objc,ada --with-system-zlib --disable-multilib --target=aarch64-linux-andr
oid --with-libgfortran --enable-static --with-gmp=/data/data/com.termux/files/usr
--with-mpfr=/data/data/com.termux/files/usr --with-mpc=/data/data/com.termux/fil
es/usr --with-isl-include=/data/data/com.termux/files/usr/include --with-isl-lib=
/data/data/com.termux/files/usr/lib --disable-isl-version-check --disable-libssp
--with-stage1-ldflags=-specs=/home/builder/.termux-build/gcc-11/tmp/specs --disab
le-tls --enable-lto --enable-gold=yes --enable-libatomic --program-suffix=-11 --e
nable-libbacktrace --enable-host-shared --enable-host-libquadmath --enable-libato
mic-ifuncs=no --enable-default-pie ac_cv_c_bigendian=no --with-libatomic --disabl
e-libstdcxx --enable-version-specific-runtime-libs --enable-eh-frame-hdr-for-stat
ic --disable-libmpx -with-gxx-include-dir=/data/data/com.termux/files/usr/include
/c++/v1 --with-arch=armv8-a --enable-fix-cortex-a53-835769 --enable-fix-cortex-a5
3-843419 --enable-libssp --disable-nls --enable-shared --enable-static --libexecd
ir=/data/data/com.termux/files/usr/libexec
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.0 (GCC)
termux-info:
Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=5792
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
sources.list
deb https://grimler.se/termux/termux-main stable main
sources.list.d/pointless.list
deb https://its-pointless.github.io/files/24 termux extras
Updatable packages:
All packages up to date
termux-tools version:
1.38.1
Android version:
13
Kernel build information:
Linux localhost 5.10.178-android13-4-gb8b945ed31a7 #1 SMP PREEMPT Tue May 16 17:0
1:54 UTC 2023 aarch64 Android
Device manufacturer:
Google
Device model:
Pixel 6a
LD Variables:
LD_LIBRARY_PATH=:/data/data/com.termux/files/usr/lib
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Any suggestions what has gone wrong? Thanks!
The text was updated successfully, but these errors were encountered: