I am new to CMake and trying to build a project for aarch64 armv8 from Termux on my android phone. I am running into this error:
gcc -o ex main.c -lc
main.c:19:10: warning: call to undeclared function ‘shm_open’; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
fd = shm_open(“/my_shm”, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
^
1 warning generated.
ld.lld: error: undefined symbol: shm_open
referenced by main.c
/data/data/com.termux/files/usr/tmp/main-8f7dab.o:(main)
did you mean: sem_open
defined in: /system/lib64/libc.so
clang-15: error: linker command failed with exit code 1 (use -v to see invocation
I found from googling that libc includes these functions and according to the fact that the error messaage suggests me to use >>> did you mean: sem_open I assume that the libc was found in my termux environment, or not? Any help or hints are very appreciated as I wasted a couple of hours already to try to fix that.
I uploaded a small project that reproduces my problem on termux from an android phone: GitHub - alexg93333/cmaketest