compile NITE2 for android platform - android

i try to compile nite2 for android platform
but it throw out some error ,
is there someone can answer my question?
ash#XxAshxX:~/usr/NITE2/NiTE-2.0.0/Samples$ cd SimpleUserTracker/
ash#XxAshxX:~/usr/NITE2/NiTE-2.0.0/Samples/SimpleUserTracker$ l
main.cpp Makefile
ash#XxAshxX:~/usr/NITE2/NiTE-2.0.0/Samples/SimpleUserTracker$ PLATFORM=Arm make
arm-none-linux-gnueabi-g++ -MD -MP -MT "./../Bin/Intermediate/Arm-Release/SimpleUserTracker/main.d ../Bin/Intermediate/Arm-Release/SimpleUserTracker/main.o" -c -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -O3 -fno-tree-pre -fno-strict-aliasing -ftree-vectorize -ffast-math -funsafe-math-optimizations -fsingle-precision-constant -Wall --sysroot=/opt/ -O2 -DNDEBUG -I../../Include -I/home/ash/usr/OpenNI2-android/Include/ -fPIC -fvisibility=hidden -o ../Bin/Intermediate/Arm-Release/SimpleUserTracker/main.o main.cpp
In file included from /home/ash/usr/OpenNI2-android/Include/Linux-Arm/OniPlatformLinux-Arm.h:25,
from /home/ash/usr/OpenNI2-android/Include/OniPlatform.h:43,
from ../../Include/NiteCAPI.h:8,
from ../../Include/NiTE.h:11,
from main.cpp:8:
/home/ash/usr/OpenNI2-android/Include/Linux-Arm/../Linux-x86/OniPlatformLinux-x86.h:31: fatal error: unistd.h: No such file or directory
compilation terminated.
make: *** [../Bin/Intermediate/Arm-Release/SimpleUserTracker/main.o] error 1

Since SimpleUserTracker utilizes a proprietary NiTE2 library its not possible to compile this source code for arm platform.

Related

Does Android clang 14 support ranges?

I tried to compile the following source file:
#include <ranges>
int main()
{
return 0;
}
with Android clang 14.0.6:
C:\Users\dmitr\AppData\Local\Android\Sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=x86_64-none-linux-android23 ^
--sysroot=C:/Users/dmitr/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB ^
-g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security ^
-fno-limit-debug-info -fPIC -fvisibility=default -fPIC -pthread -std=gnu++20 -MD -MT -c a.cpp
I get the following compiler error:
a.cpp:2:10: fatal error: 'ranges' file not found
are std::ranges supported by Android clang 14?
I thought that it probably supports because I found something about ranges here:

ffmpeg build error looks tmp file creat fail?

./configure --target-os=android --prefix=$PREFIX \
--enable-cross-compile --enable-runtime-cpudetect --disable-asm --arch=arm \
--cc=$PREBUILT/linux-x86_64/bin/arm-linux-androideabi-gcc \
--cross-prefix=$PREBUILT/linux-x86_64/bin/arm-linux-androideabi- \
--disable-stripping --nm=$PREBUILT/linux-x86_64/bin/arm-linux-androideabi-nm --sysroot=$PLATFORM --enable-gpl --enable-shared --disable-static --enable-small --disable-ffprobe --disable-ffplay --disable-ffmpeg --disable-ffserver --disable-debug --extra-cflags="-fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -marm -march=armv7-a"
this is out put log:
Makefile:2: config.mak: 没有那个文件或目录
Makefile:67: /common.mak: 没有那个文件或目录
Makefile:109: /libavutil/Makefile: 没有那个文件或目录
Makefile:109: /library.mak: 没有那个文件或目录
Makefile:111: /doc/Makefile: 没有那个文件或目录
Makefile:198: /tests/Makefile: 没有那个文件或目录
make: *** No rule to make target '/tests/Makefile'。 停止。
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user#ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.
but my gcc path works fine
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
arm-linux-androideabi-gcc: fatal error: no input files
compilation terminated.
I seems the temp file not create ,I can't find temp file in /tmp
this is end of config.log file:
dition: defined __ARM_ARCH_6T2__ || defined __TARGET_ARCH_6T2"
^
compilation terminated due to -Wfatal-errors.
check_cpp_condition stddef.h defined __ARM_ARCH_7__ || defined __TARGET_ARCH_7
check_cpp
BEGIN /tmp/ffconf.FHwGDPbC.c
1 #include <stddef.h>
2 #if !(defined __ARM_ARCH_7__ || defined __TARGET_ARCH_7)
3 #error "unsatisfied condition: defined __ARM_ARCH_7__ || defined __TARGET_ARCH_7"
4 #endif
END /tmp/ffconf.FHwGDPbC.c
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/opt/android/android-sdk-linux/ndk-bundle/platforms/android-arm -isysroot /opt/android/android-sdk-linux/ndk-bundle/platforms/android-arm -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -marm -march=armv7-a -E -o /tmp/ffconf.csA8Jm6F.o /tmp/ffconf.FHwGDPbC.c
/tmp/ffconf.FHwGDPbC.c:3:2: error: #error "unsatisfied condition: defined __ARM_ARCH_7__ || defined __TARGET_ARCH_7"
#error "unsatisfied condition: defined __ARM_ARCH_7__ || defined __TARGET_ARCH_7"
^
compilation terminated due to -Wfatal-errors.
check_cpp_condition stddef.h defined __ARM_ARCH_7A__ || defined __TARGET_ARCH_7_A
check_cpp
BEGIN /tmp/ffconf.FHwGDPbC.c
1 #include <stddef.h>
2 #if !(defined __ARM_ARCH_7A__ || defined __TARGET_ARCH_7_A)
3 #error "unsatisfied condition: defined __ARM_ARCH_7A__ || defined __TARGET_ARCH_7_A"
4 #endif
END /tmp/ffconf.FHwGDPbC.c
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/opt/android/android-sdk-linux/ndk-bundle/platforms/android-arm -isysroot /opt/android/android-sdk-linux/ndk-bundle/platforms/android-arm -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -marm -march=armv7-a -E -o /tmp/ffconf.csA8Jm6F.o /tmp/ffconf.FHwGDPbC.c
check_ld cc
check_cc
BEGIN /tmp/ffconf.FHwGDPbC.c
1 int main(void){ return 0; }
END /tmp/ffconf.FHwGDPbC.c
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/opt/android/android-sdk-linux/ndk-bundle/platforms/android-arm -isysroot /opt/android/android-sdk-linux/ndk-bundle/platforms/android-arm -fPIC -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -marm -march=armv7-a -march=armv7-a -c -o /tmp/ffconf.csA8Jm6F.o /tmp/ffconf.FHwGDPbC.c
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --sysroot=/opt/android/android-sdk-linux/ndk-bundle/platforms/android-arm -isysroot /opt/android/android-sdk-linux/ndk-bundle/platforms/android-arm -march=armv7-a -o /tmp/ffconf.fjKb0Qb0 /tmp/ffconf.csA8Jm6F.o
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc
/opt/android/android-sdk-linux/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl
collect2: error: ld returned 1 exit status
C compiler test failed.
Default NDK toolchain is unsuitable for compiling Autoconf projects. You'll need to generate standalong toolchain as described here. If this does not help, you should examine the failing command in config.log and see what exactly goes wrong (simple gcc test won't help as errors may be caused by linker).

cpu-features.h no such file or directory webrtc Android build

i am building webrtc for Android & i had followed following steps for generating webrtc library:
source build/android/envsetup.sh
python webrtc/build/gyp_webrtc
ninja -c out/Debug
this generates following error:
ninja: build stopped: subcommand failed. ninja: Entering directory
`./out/Release/' [3/2806] CC
obj/webrtc/system_wrappers/source/cpu_features_android.cpu_features_android.o
FAILED:
/home/rtcdev/Nishant/src/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
-MMD -MF obj/webrtc/system_wrappers/source/cpu_features_android.cpu_features_android.o.d
-DV8_DEPRECATION_WARNINGS -DCLD_VERSION=1 -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DDISABLE_NACL
-DCHROMIUM_BUILD -DCR_CLANG_REVISION=233105-2 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1
-DUSE_PROPRIETARY_CODECS -DENABLE_BROWSER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS
-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDONT_EMBED_BUILD_METADATA -DFIELDTRIAL_TESTING_ENABLED
-DENABLE_AUTOFILL_DIALOG=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_SPELLCHECK=1
-DUSE_BROWSER_SPELLCHECKER=1 -DENABLE_SUPERVISED_USERS=1 -DVIDEO_HOLE=1 -DV8_USE_EXTERNAL_STARTUP_DATA
-DENABLE_WEBVR -DMOBILE_SAFE_BROWSING -DSAFE_BROWSING_DB_REMOTE -DSAFE_BROWSING_SERVICE
-DEXPAT_RELATIVE_PATH -DWEBRTC_MODULE_UTILITY_VIDEO -DWEBRTC_ARCH_ARM -DWEBRTC_ARCH_ARM_V7
-DWEBRTC_DETECT_ARM_NEON -DWEBRTC_POSIX -DWEBRTC_LINUX -DWEBRTC_ANDROID -DWEBRTC_ANDROID_OPENSLES -DUSE_LIBPCI=1
-DUSE_OPENSSL=1 -DUSE_OPENSSL_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DANDROID -D__GNU_SOURCE=1
'-DCHROME_BUILD_ID=""' -DHAVE_SYS_UIO_H -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0
-D_FORTIFY_SOURCE=2
-Igen -I../..
-fstack-protector --param=ssp-buffer-size=4 -Werror -fno-strict-aliasing
-Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs
-Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-strict-overflow -fno-builtin-cos -fno-builtin-sin
-fno-builtin-cosf -fno-builtin-sinf -march=armv7-a -mtune=generic-armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp
-mthumb -fno-tree-sra -fno-caller-saves -Wno-psabi -mthumb-interwork -ffunction-sections -funwind-tables
-g -fstack-protector -fno-short-enums -finline-limit=64
--sysroot=../../third_party/android_tools/ndk//platforms/android-16/arch-arm
-isystem../../third_party/android_tools/ndk//sources/cxx-stl/llvm-libc++/libcxx/include
-isystem../../third_party/android_tools/ndk//sources/cxx-stl/llvm-libc++abi/libcxxabi/include
-isystem../../third_party/android_tools/ndk//sources/android/support/include
-Os -fno-ident -fdata-sections -ffunction-sections -fomit-frame-pointer -funwind-tables
-c ../../webrtc/system_wrappers/source/cpu_features_android.c
-o obj/webrtc/system_wrappers/source/cpu_features_android.cpu_features_android.o
../../webrtc/system_wrappers/source/cpu_features_android.c:11:26:
fatal error: cpu-features.h: No such file or directory #include
^ compilation terminated.
Does Anyone have Any idea by seeing webrtc Flags, what i am missing for webrtc Android?
The compiler could not find the header file cpu-features.h, so find out which directory it resides, and then add that directory to the compiler flags, just like the other directory you already have.

Building Boost Library for Android on OS X Mavericks

I'm having an issue with attempting to build boost library for android. I have the apple command line tools installed and I downloaded boost. I kept getting this error:
In file included from libs/thread/src/pthread/thread.cpp:9:
In file included from ./boost/thread/detail/config.hpp:11:
In file included from ./boost/config.hpp:57:
In file included from ./boost/config/platform/macos.hpp:28:
./boost/config/posix_features.hpp:18:15: fatal error: 'unistd.h' file not found
# include <unistd.h>
^
1 error generated.
...failed gcc.compile.c++ bin.v2/libs/thread/build/gcc-android/release/link-static/runtime-link-static/threading-multi/pthread/thread.o...
gcc.compile.c++ bin.v2/libs/thread/build/gcc-android/release/link-static/runtime-link-static/threading-multi/pthread/once.o
"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -Wno-unused-function --sysroot=/Users/mac/src/android/tc/sysroot -fPIC -O3 -Wextra -Wno-long-long -Wno-variadic-macros -Wunused-function -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_THREAD_POSIX -DNDEBUG -I"." -c -o "bin.v2/libs/thread/build/gcc-android/release/link-static/runtime-link-static/threading-multi/pthread/once.o" "libs/thread/src/pthread/once.cpp"
In file included from libs/thread/src/pthread/once.cpp:6:
In file included from ./boost/thread/detail/config.hpp:11:
In file included from ./boost/config.hpp:57:
In file included from ./boost/config/platform/macos.hpp:28:
./boost/config/posix_features.hpp:18:15: fatal error: 'unistd.h' file not found
# include <unistd.h>
^
1 error generated.
...failed gcc.compile.c++ bin.v2/libs/thread/build/gcc-android/release/link-static/runtime-link-static/threading-multi/pthread/once.o...
gcc.compile.c++ bin.v2/libs/thread/build/gcc-android/release/link-static/runtime-link-static/threading-multi/future.o
"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pedantic -Wno-unused-function --sysroot=/Users/mac/src/android/tc/sysroot -fPIC -O3 -Wextra -Wno-long-long -Wno-variadic-macros -Wunused-function -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_STATIC_LINK=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_THREAD_POSIX -DNDEBUG -I"." -c -o "bin.v2/libs/thread/build/gcc-android/release/link-static/runtime-link-static/threading-multi/future.o" "libs/thread/src/future.cpp"
In file included from libs/thread/src/future.cpp:6:
In file included from ./boost/thread/detail/config.hpp:11:
In file included from ./boost/config.hpp:57:
In file included from ./boost/config/platform/macos.hpp:28:
./boost/config/posix_features.hpp:18:15: fatal error: 'unistd.h' file not found
# include <unistd.h>
^
1 error generated.
I got the same when building Boost 1.55.0 on Maverick with MacOSX10.7.sdk. So I added -I/usr/include to cflags and cxxflags options in my compile command. It resolved this problem. My full command.
./b2 -d+2 toolset=clang cxxflags="-stdlib=libc++ -isysroot=$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -I/usr/include" cflags="-stdlib=libc++ -isysroot=$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -I/usr/include" --layout=system --build-type=minimal --prefix=$QTDIR link=static runtime-link=static variant=release install

Android NDK, Navit

I am building navit with standalone tools from NDK r7.
./configure is able to pass the compiler test.
However when I run make, I get the following error w.r.t headers.
It is looking for machine/internal_types.h which is not available either with NDK C headers or standard gcc headers. Is this due to incorrect compiler options?
Error Log below.
make[2]: Entering directory `/home/sateesh/navit/navit/fib-1.1'
/bin/bash ../../libtool --tag=CC --mode=compile
i686-android-linux-gcc -nostdlib -march=i686 -mstackrealign
-L/opt/ndk_x86_r7/lib -L. -I/opt/ndk_x86_r7/usr/include -DHAVE_CONFIG_H -I. -I../.. -g -O2 -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -ffast-math -I../../intl/ -MT fib.lo -MD -MP -MF .deps/fib.Tpo -c -o fib.lo fib.c
libtool: compile: i686-android-linux-gcc -nostdlib -march=i686
-mstackrealign -L/opt/ndk_x86_r7/lib -L. -I/opt/ndk_x86_r7/usr/include -DHAVE_CONFIG_H -I. -I../.. -g -O2 -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -ffast-math -I../../intl/ -MT fib.lo -MD -MP -MF .deps/fib.Tpo -c fib.c -fPIC -DPIC -o .libs/fib.o
In file included from
/opt/ndk_x86_r7/bin/../sysroot/usr/include/limits.h:86,
from /opt/ndk_x86_r7/bin/../lib/gcc/i686-android-linux/4.4.3/include-fixed/limits.h:122,
from /opt/ndk_x86_r7/bin/../lib/gcc/i686-android-linux/4.4.3/include-fixed/syslimits.h:7,
from /opt/ndk_x86_r7/bin/../lib/gcc/i686-android-linux/4.4.3/include-fixed/limits.h:11,
from fib.c:33:
/opt/ndk_x86_r7/bin/../sysroot/usr/include/sys/limits.h:44:36: error:
machine/internal_types.h: No such file or directory
/opt/ndk_x86_r7/bin/../sysroot/usr/include/sys/limits.h:47:28:
error: machine/limits.h: No such file or directory

Categories

Resources