cc1: erro: opção de linha de comando não reconhecida '-std = c11'

0

Recebi este erro ao compilar cc1: error: unrecognized command line option '-std=c11' de um projeto. Todos os problemas relacionados sugerem usar um gcc maior que 4,7, mas eu já tenho um gcc maior que 4,7.Este é os detalhes

gcc version 6.3.0 20170519 (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04)

Estou tentando compilar este link . O problema está ocorrendo neste arquivo link enquanto o ndk-build.

Isso é o que estou fazendo

-vbox:~/eSpeak/espeak-master/android/jni$ ndk-build
Compile mips   : ttsespeak <= case.c
cc1: error: unrecognized command line option '-std=c11'
make: *** [/home/apertium/eSpeak/espeak-master/android/obj/local/mips/objs/ttsespeak/__/__/src/ucd-tools/src/case.o] Error 1
O comando

ndk-build V=1 fornecerá o seguinte log.

apertium@ap-vbox:~/eSpeak/espeak-master/android/jni$ ndk-build V=1 
rm -f /home/apertium/eSpeak/espeak-master/android/libs/armeabi/lib*.so /home/apertium/eSpeak/espeak-master/android/libs/armeabi-v7a/lib*.so /home/apertium/eSpeak/espeak-master/android/libs/mips/lib*.so /home/apertium/eSpeak/espeak-master/android/libs/x86/lib*.so 
rm -f /home/apertium/eSpeak/espeak-master/android/libs/armeabi/gdbserver /home/apertium/eSpeak/espeak-master/android/libs/armeabi-v7a/gdbserver /home/apertium/eSpeak/espeak-master/android/libs/mips/gdbserver /home/apertium/eSpeak/espeak-master/android/libs/x86/gdbserver 
rm -f /home/apertium/eSpeak/espeak-master/android/libs/armeabi/gdb.setup /home/apertium/eSpeak/espeak-master/android/libs/armeabi-v7a/gdb.setup /home/apertium/eSpeak/espeak-master/android/libs/mips/gdb.setup /home/apertium/eSpeak/espeak-master/android/libs/x86/gdb.setup 
Compile mips : ttsespeak <= case.c 
/home/apertium/android-ndk-x86/android-ndk-r9/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86/bin/mipsel-linux-android-gcc -MMD -MP -MF /home/apertium/eSpeak/espeak-master/android/obj/local/mips/objs/ttsespeak/__/__/src/ucd-tools/src/case.o.d -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -no-canonical-prefixes -O2 -g -DNDEBUG -fomit-frame-pointer -funswitch-loops -finline-limit=300 -I/home/apertium/eSpeak/espeak-master/android/jni/include -I/home/apertium/eSpeak/espeak-master/android/jni/../../src/ucd-tools/src/include -I/home/apertium/eSpeak/espeak-master/android/jni/../../src/include -I/home/apertium/eSpeak/espeak-master/android/jni -DANDROID -std=c11 -DINCLUDE_KLATT -DINCLUDE_SONIC -Wa,--noexecstack -Wformat -Werror=format-security -I/home/apertium/android-ndk-x86/android-ndk-r9/platforms/android-14/arch-mips/usr/include -c /home/apertium/eSpeak/espeak-master/android/jni/../../src/ucd-tools/src/case.c -o /home/apertium/eSpeak/espeak-master/android/obj/local/mips/objs/ttsespeak/__/__/src/ucd-tools/src/case.o 
cc1: error: unrecognized command line option '-std=c11' 
make: *** [/home/apertium/eSpeak/espeak-master/android/obj/local/mips/objs/ttsespeak/__/__/src/ucd-tools/src/case.o] Error 1

Qualquer ajuda é muito apreciada.

    
por sunil sunny 16.11.2017 / 07:28

1 resposta

1

Com a ajuda de David Foerster descobri que o erro mencionado acima se deve ao fato de que o Android NDK inclui seu próprio compilador C, então meu NDK estava usando o GCC 4.6 que não suporta C11 Então eu atualizei meu NDK para r16 e resultou no erro abaixo.

root@ap-vbox:~/eSpeak/espeak-master# make V=1 apk-release
cd android && ndk-build
/home/apertium/android-ndk-r-16/android-ndk-r16/prebuilt/linux-x86_64/bin/python: 10: /home/apertium/android-ndk-r-16/android-ndk-r16/prebuilt/linux-x86_64/bin/python: Syntax error: word unexpected (expecting ")")
/home/apertium/android-ndk-r-16/android-ndk-r16/prebuilt/linux-x86_64/bin/python: 10: /home/apertium/android-ndk-r-16/android-ndk-r16/prebuilt/linux-x86_64/bin/python: Syntax error: word unexpected (expecting ")")
Android NDK: WARNING: APP_PLATFORM android-14 is higher than android:minSdkVersion 1 in ./AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-14. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.    
/home/apertium/android-ndk-r-16/android-ndk-r16/prebuilt/linux-x86_64/bin/python: 10: /home/apertium/android-ndk-r-16/android-ndk-r16/prebuilt/linux-x86_64/bin/python: Syntax error: word unexpected (expecting ")")
make[1]: Entering directory '/home/apertium/eSpeak/espeak-master/android'
rm -f ./libs/arm64-v8a/* ./libs/armeabi/* ./libs/armeabi-v7a/* ./libs/mips/* ./libs/mips64/* ./libs/x86/* ./libs/x86_64/*
rm -f ./libs/arm64-v8a/gdbserver ./libs/armeabi/gdbserver ./libs/armeabi-v7a/gdbserver ./libs/mips/gdbserver ./libs/mips64/gdbserver ./libs/x86/gdbserver ./libs/x86_64/gdbserver
rm -f ./libs/arm64-v8a/gdb.setup ./libs/armeabi/gdb.setup ./libs/armeabi-v7a/gdb.setup ./libs/mips/gdb.setup ./libs/mips64/gdb.setup ./libs/x86/gdb.setup ./libs/x86_64/gdb.setup
[mips] Compile        : ttsespeak <= case.c
/home/apertium/android-ndk-r-16/android-ndk-r16/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -MMD -MP -MF ./obj/local/mips/objs/ttsespeak/__/__/src/ucd-tools/src/case.o.d -gcc-toolchain /home/apertium/android-ndk-r-16/android-ndk-r16/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64 -target mipsel-none-linux-android -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fmessage-length=0 -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes  -g -mips32 -O2 -DNDEBUG  -Ijni/include -Ijni/../../src/ucd-tools/src/include -Ijni/../../src/include -Ijni   -DANDROID -std=c11 -DINCLUDE_KLATT -DINCLUDE_SONIC -D__ANDROID_API__=14 -Wa,--noexecstack -Wformat -Werror=format-security  --sysroot /home/apertium/android-ndk-r-16/android-ndk-r16/sysroot -isystem /home/apertium/android-ndk-r-16/android-ndk-r16/sysroot/usr/include/mipsel-linux-android -c  jni/../../src/ucd-tools/src/case.c -o ./obj/local/mips/objs/ttsespeak/__/__/src/ucd-tools/src/case.o
/home/apertium/android-ndk-r-16/android-ndk-r16/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: 1: /home/apertium/android-ndk-r-16/android-ndk-r16/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: Syntax error: ")" unexpected
make[1]: *** [obj/local/mips/objs/ttsespeak/__/__/src/ucd-tools/src/case.o] Error 2
make[1]: Leaving directory '/home/apertium/eSpeak/espeak-master/android'
make: *** [jni] Error 2

Eu estava usando uma caixa virtual para isso. Mas quando eu tentei compilar o mesmo em um sistema instalado Ubuntu não houve problemas. Tudo correu bem e compilado. Então, acho que o problema foi com minha caixa virtual.

    
por sunil sunny 23.11.2017 / 06:49