C++ ARM GCC:冲突的CPU架构

C++ ARM GCC:冲突的CPU架构,c++,c,gcc,arm,C++,C,Gcc,Arm,升级到ubuntu 18.04后,我无法再编译我的应用程序。我正在使用带有st nucleo板的mbed cli。这是命令mbed compile [Warning] test.c@1926,32: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas] Link: sensors /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /u

升级到ubuntu 18.04后,我无法再编译我的应用程序。我正在使用带有st nucleo板的mbed cli。这是命令
mbed compile

[Warning] test.c@1926,32: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
Link: sensors
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o: Conflicting CPU architectures 13/1
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-setjmp.o): Conflicting CPU architectures 13/1
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-setjmp.o)
collect2: error: ld returned 1 exit status
[ERROR] /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o: Conflicting CPU architectures 13/1
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-setjmp.o): Conflicting CPU architectures 13/1
/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-setjmp.o)
collect2: error: ld returned 1 exit status

[mbed] ERROR: "/usr/bin/python" returned error code 1.
[mbed] ERROR: Command "/usr/bin/python -u /home/user/examples/mbed-os/tools/make.py -t GCC_ARM -m nucleo_f411re --source . --build ./BUILD/nucleo_f411re/GCC_ARM" in "/home/user/examples"

这是一个Ubuntu 18.04特定版本。已经提出了

解决方法是从PPA安装
arm none eabi gcc
。以下是说明:

  • 卸下已安装的一个:

    sudo apt remove gcc-arm-none-eabi
    
  • 安装PPA中的一个:

    sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
    sudo apt-get update
    sudo apt-get install gcc-arm-embedded
    
    sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
    sudo apt-get update
    sudo apt-get install gcc-arm-embedded
    

这是一个Ubuntu 18.04特定版本。已经提出了

解决方法是从PPA安装
arm none eabi gcc
。以下是说明:

  • 卸下已安装的一个:

    sudo apt remove gcc-arm-none-eabi
    
  • 安装PPA中的一个:

    sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
    sudo apt-get update
    sudo apt-get install gcc-arm-embedded
    
    sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
    sudo apt-get update
    sudo apt-get install gcc-arm-embedded
    

    • 不幸的是,我无法评论奥利维姆的回答,但有重要的补充

      正如OlivierM之前所述,您应该删除已安装的软件并从嵌入式存储库中安装新软件,但如果您从主代表处安装了gcc arm none eabi,它也将安装binutils arm none eabi,这将与gcc arm embedded冲突

      • 因此,您应该删除gcc arm none eabi和binutils arm none eabi:

        sudo apt-get remove binutils-arm-none-eabi
        sudo apt-get remove gcc-arm-none-eabi
        
      • 现在从PPA安装:

        sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
        sudo apt-get update
        sudo apt-get install gcc-arm-embedded
        
        sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
        sudo apt-get update
        sudo apt-get install gcc-arm-embedded
        

        • 不幸的是,我无法评论奥利维姆的回答,但有重要的补充

          正如OlivierM之前所述,您应该删除已安装的软件并从嵌入式存储库中安装新软件,但如果您从主代表处安装了gcc arm none eabi,它也将安装binutils arm none eabi,这将与gcc arm embedded冲突

          • 因此,您应该删除gcc arm none eabi和binutils arm none eabi:

            sudo apt-get remove binutils-arm-none-eabi
            sudo apt-get remove gcc-arm-none-eabi
            
          • 现在从PPA安装:

            sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
            sudo apt-get update
            sudo apt-get install gcc-arm-embedded
            
            sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
            sudo apt-get update
            sudo apt-get install gcc-arm-embedded
            

          可能与此处描述的问题相同:使用mbed编译时,请确保使用受支持的工具链。您可能被迫使用与@AdrianoRepetti评论的帖子无关的gcc 5。可能与此处描述的问题相同:使用mbed编译时,请确保使用受支持的工具链。您可能被迫使用与@AdrianoRepetti评论的帖子无关的gcc 5。