Trying to compile x265 for use with arm64-v8a. After successuful build of x265 itself, I receive the following error when ffmpeg is about to compile:
require_pkg_config libx265 x265 x265.h x265_api_get
check_pkg_config libx265 x265 x265.h x265_api_get
test_pkg_config libx265 x265 x265.h x265_api_get
/root/ffmpeg_android/ffmpeg-android-1.6.3/ffmpeg-pkg-config --exists --print-errors x265
check_func_headers x265.h x265_api_get -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/include/x265 -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib -lx265
test_ld cc -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/include/x265 -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib -lx265
test_cc -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/include/x265 -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib
BEGIN /tmp/ffconf.xKyjnplW/test.c
1 #include <x265.h>
2 #include <stdint.h>
3 long check_x265_api_get(void) { return (long) x265_api_get; }
4 int main(void) { int ret = 0;
5 ret |= ((intptr_t)check_x265_api_get) & 0xFFFF;
6 return ret; }
END /tmp/ffconf.xKyjnplW/test.c
/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/bin/aarch64-linux-android-clang -DANDROID -fpic -fpie -march=armv8-a --sysroot=/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/sysroot -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -DANDROID -fpic -fpie -march=armv8-a -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/vpx/android/arm64-v8a/include -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x264/android/arm64-v8a/include/x264 -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/include/x265 -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/lame/android/arm64-v8a/include -DANDROID -fpic -fpie -march=armv8-a --static -mcpu=cortex-a57 -std=c11 -fPIE -fomit-frame-pointer -fPIC -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/include/x265 -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib -c -o /tmp/ffconf.xKyjnplW/test.o /tmp/ffconf.xKyjnplW/test.c
clang60: warning: argument unused during compilation: '-L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib' [-Wunused-command-line-argument]
/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/bin/aarch64-linux-android-clang -Wl,-z,defs -Wl,--unresolved-symbols=report-all -march=armv8-a -L/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/sysroot -Wl,-z,relro -Wl,-z,now -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/vpx/android/arm64-v8a/lib -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x264/android/arm64-v8a/lib -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/lame/android/arm64-v8a/lib -Wl,-z,defs -Wl,--unresolved-symbols=report-all -march=armv8-a -L/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/sysroot -Wl,-z,relro -Wl,-z,now --static --sysroot=/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/sysroot -mcpu=cortex-a57 -Wl,--as-needed -Wl,-z,noexecstack -fPIE -pie -I/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/include/x265 -L/root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib -o /tmp/ffconf.xKyjnplW/test /tmp/ffconf.xKyjnplW/test.o -lx265 -lgcc
clang60: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: skipping incompatible /root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib/libx265.a when searching for -lx265
/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: skipping incompatible /root/ffmpeg_android/ffmpeg-android-1.6.3/jni/x265/android/arm64-v8a/lib/libx265.a when searching for -lx265
/root/ffmpeg_android/ffmpeg-android-1.6.3/toolchain-android/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: cannot find -lx265
clang60: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: x265 not found using pkg-config
I use ffmpeg 4.1.3 and the latest version of x265 sources. I use this project to compile and I have succeeded when building without x265. I compile on Debian Buster x64.
I ended up using the scripts from this project that uses all latest NDK and ffmpeg together with every latest library, in order to create an ffmpeg binary. It works pretty well on my device and by modifying a bit, I got a static ffmpeg as well. I only needed to add 2 extra native libraries to my app for it to work. It even uses all CPU features so it is the fastest solution for mobiles.
Related
Does anybody enabled code coverage NDK build on Android?
by using cmake with the comments from this link code coverage for native code using Android NDK
I ended up with the same error:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
so I'm creating a new thread for asking this issue.
The "same error" from the other thread:
[3/3] Linking CXX shared library ../../../../build/intermediates/cmake/project/debug/obj/armeabi/libscanhwl_camif.so
FAILED: : && /home/user/tools/android-ndk-r14b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv5te-none-linux-androideabi --gcc-toolchain=/home/user/tools/android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 --sysroot=/home/user/tools/android-ndk-r14b/sysroot -fPIC -isystem /home/user/tools/android-ndk-r14b/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=19 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -D__STDC_FORMAT_MACROS -fexceptions -frtti --coverage -fprofile-arcs -ftest-coverage -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot /home/user/tools/android-ndk-r14b/platforms/android-19/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libscanhwl_camif.so -o -latomic -lm "/home/user/tools/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/libgnustl_static.a" && :
out/stage2/soong/ndk/sysroot/usr/include/string.h:348: error: undefined reference to '__strncpy_chk2'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Step one would be using a newer NDK (not sure which you're using, the other person was using r14b which is ancient). It looks like the coverage runtime library was built against a newer version of Android than you're using and so it can't be used usefully in the NDK. If you have the same issue in r17b, it's an NDK bug.
Note that coverage isn't something we really have support for right now, but it's on my todo list: https://github.com/android-ndk/ndk/issues/612.
When I open a new project that support C++ in Android Studio, It only outputs "Hello C++",And I didn't modify any code. I have tried to change the version of Android Studio and SDK. But it always show the same error.
My development platform: Windows 10
Now version: Android Studio 3.1.2
Thank you very much
Error While Building:
Build command failed.
Error while executing process C:\Users\15829\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\15829\AndroidStudioProjects\MyApplication\app -BC:\Users\15829\AndroidStudioProjects\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\15829\AndroidStudioProjects\MyApplication\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\15829\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\15829\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\15829\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" is not able to compile a simple test program.
Open File
It fails with the following output:
Change Dir: C:/Users/15829/AndroidStudioProjects/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build
Command:"C:\Users\15829\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe"
"cmTC_a2146"
[1/2] Building C object CMakeFiles/cmTC_a2146.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_a2146
FAILED: cmd.exe /C "cd . &&
C:\Users\15829\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe
--target=armv7-none-linux-androideabi
--gcc-toolchain=C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64
--sysroot=C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/sysroot
-isystem
C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=15 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv7-a
-mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat
-Werror=format-security -Wl,--exclude-libs,libgcc.a
-Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot
C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm
-Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings
-Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a
-LC:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a
-Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro
-Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc
CMakeFiles/cmTC_a2146.dir/testCCompiler.c.o -o cmTC_a2146 -latomic -lm &&
cd ."
error: no such file or directory:
'CMakeFiles/cmTC_a2146.dir/testCCompiler.c.o'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/Users/15829/AndroidStudioProjects/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/15829/AndroidStudioProjects/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeError.log".
Build command failed.
Error while executing process C:\Users\15829\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\15829\AndroidStudioProjects\MyApplication\app -BC:\Users\15829\AndroidStudioProjects\MyApplication\app\.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\15829\AndroidStudioProjects\MyApplication\app\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\15829\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\15829\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\15829\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" is not able to compile a simple test program.
Open File
It fails with the following output:
Change Dir: C:/Users/15829/AndroidStudioProjects/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build
Command:"C:\Users\15829\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe"
"cmTC_e2e33"
[1/2] Building C object CMakeFiles/cmTC_e2e33.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_e2e33
FAILED: cmd.exe /C "cd . &&
C:\Users\15829\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe
--target=armv7-none-linux-androideabi
--gcc-toolchain=C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64
--sysroot=C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/sysroot
-isystem
C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=15 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv7-a
-mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat
-Werror=format-security -Wl,--exclude-libs,libgcc.a
-Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot
C:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/platforms/android-15/arch-arm
-Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings
-Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a
-LC:/Users/15829/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a
-Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro
-Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc
CMakeFiles/cmTC_e2e33.dir/testCCompiler.c.o -o cmTC_e2e33 -latomic -lm &&
cd ."
error: no such file or directory:
'CMakeFiles/cmTC_e2e33.dir/testCCompiler.c.o'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/Users/15829/AndroidStudioProjects/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/15829/AndroidStudioProjects/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeError.log".
Try to add this to your build.gradle:
externalNativeBuild {
cmake {
arguments '-DANDROID_TOOLCHAIN=clang' --> gcc
}
}
./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).
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.
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