Skip to content
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

Unrecognized command-line options error when building for android #3689

Open
Bugsia opened this issue Oct 9, 2023 · 3 comments
Open

Unrecognized command-line options error when building for android #3689

Bugsia opened this issue Oct 9, 2023 · 3 comments

Comments

@Bugsia
Copy link

Bugsia commented Oct 9, 2023

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?

@Bugsia Bugsia changed the title Unrecognized command-line options when building for android Unrecognized command-line options error when building for android Oct 9, 2023
@BenzhengZhang
Copy link
Collaborator

please try this command:
make OS=android TRAGET=android-xx NDKROOT=your/ndk/path NDK_TOOLCHAIN_VERSION=clang

@LoyaiHai
Copy link

LoyaiHai commented Nov 3, 2023

请尝试此命令: 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

@BenzhengZhang
Copy link
Collaborator

请尝试此命令: 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants