Unrecognized command-line options error when building for android
I am trying to build Openh264 for android on wsl ubuntu.
With the command make OS=android NDKROOT=/root/Android/Sdk/ndk/26.0.10792818 TARGET=34 I get the output
/root/Android/Sdk/ndk/26.0.10792818/build/core/add-application.mk:177: *** Android NDK: APP_STL stlport_shared is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information. . Stop. /root/Android/Sdk/ndk/26.0.10792818/build/core/add-application.mk:177: *** Android NDK: APP_STL stlport_shared is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information. . Stop. /root/Android/Sdk/ndk/26.0.10792818/build/core/add-application.mk:177: *** Android NDK: APP_STL stlport_shared is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information. . Stop. /root/Android/Sdk/ndk/26.0.10792818/build/core/add-application.mk:177: *** Android NDK: APP_STL stlport_shared is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information. . Stop. gcc -O3 -DNDEBUG -DHAVE_NEON -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -DANDROID_NDK -fpic --sysroot=/root/Android/Sdk/ndk/26.0.10792818/platforms/android-12/arch-arm -MMD -MP -fstack-protector-all -isystem /root/Android/Sdk/ndk/26.0.10792818/sysroot/usr/include -isystem /root/Android/Sdk/ndk/26.0.10792818/sysroot/usr/include/ -D__ANDROID_API__=12 -DGENERATED_VERSION_HEADER -I./codec/api/wels -I./codec/common/inc -Icodec/common/inc -Dandroid_getCpuIdArm=wels_getCpuIdArm -Dandroid_setCpuArm=wels_setCpuArm -Dandroid_getCpuCount=wels_getCpuCount -Dandroid_getCpuFamily=wels_getCpuFamily -Dandroid_getCpuFeatures=wels_getCpuFeatures -Dandroid_setCpu=wels_setCpu -I/root/Android/Sdk/ndk/26.0.10792818/sources/android/cpufeatures -c -o codec/common/src/cpu-features.o /root/Android/Sdk/ndk/26.0.10792818/sources/android/cpufeatures/cpu-features.c gcc: error: unrecognized command-line option ‘-mfloat-abi=softfp’ gcc: error: unrecognized command-line option ‘-mfpu=vfpv3-d16’ make: *** [build/platform-android.mk:138: codec/common/src/cpu-features.o] Error 1
So the error is
gcc: error: unrecognized command-line option ‘-mfloat-abi=softfp’
gcc: error: unrecognized command-line option ‘-mfpu=vfpv3-d16’
I have the newest versions of Android Studio with SDK and NDK as I just installed them. Same with NASM and OpenH264 itself. Is there a solution for this?
please try this command: make OS=android TRAGET=android-xx NDKROOT=your/ndk/path NDK_TOOLCHAIN_VERSION=clang
请尝试此命令: make OS=android TRAGET=android-xx NDKROOT=your/ndk/path NDK_TOOLCHAIN_VERSION=clang
when i try to: make OS=android TRAGET=android-xx NDKROOT=your/ndk/path NDK_TOOLCHAIN_VERSION=clang It shows an error message: /home/lhs/pjsip/pjsip-install/android-ndk-r22b/sources/android/cpufeatures/cpu-features.h:31:10: fatal error: 'sys/cdefs.h' file not found #include <sys/cdefs.h> ^~~~~~~~~~~~~ 1 error generated. make: *** [build/platform-android.mk:138: codec/common/src/cpu-features.o] Error 1
请尝试此命令: make OS=android TRAGET=android-xx NDKROOT=your/ndk/path NDK_TOOLCHAIN_VERSION=clang
when i try to: make OS=android TRAGET=android-xx NDKROOT=your/ndk/path NDK_TOOLCHAIN_VERSION=clang It shows an error message: /home/lhs/pjsip/pjsip-install/android-ndk-r22b/sources/android/cpufeatures/cpu-features.h:31:10: fatal error: 'sys/cdefs.h' file not found #include <sys/cdefs.h> ^~~~~~~~~~~~~ 1 error generated. make: *** [build/platform-android.mk:138: codec/common/src/cpu-features.o] Error 1
Maybe you didn't pull the latest version of the code?