Arm linux gnueabi gcc fatal error cannot execute cc1plus execvp

Full error message: arm-linux-gnueabihf-g++: error trying to exec 'cc1plus': execvp: No such file or directory So I have got this error message while trying to build a C++ project on my machine sh...

Full error message:
arm-linux-gnueabihf-g++: error trying to exec ‘cc1plus’: execvp: No such file or directory

So I have got this error message while trying to build a C++ project on my machine shortly after a home directory deletion and recovery on Ubuntu 18.04. I’m doubtful that this is because of something in my environment since I built my program not too long ago with the same settings. After researching the error, I found that pretty much everyone says that it’s because I have either not installed gcc/g++, incorrectly installed gcc/g++, or have a version mismatch between gcc/g++.

However this appears to not be my problem:

jayz@joshz:/usr$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

jayz@joshz:/usr$ g++ --version
g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I have also tried reinstalling both gcc and g++ but still the same error appears.

I have also tried:

sudo apt-get update
sudo apt-get install --reinstall build-essential

I have in fact found the cc1plus file on my system in multiple places:

jayz@joshz:/usr$ locate cc1plus
/home/jayz/raspi/sysroot/usr/lib/gcc/arm-linux-gnueabihf/4.9/cc1plus
/home/jayz/raspi/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/libexec/gcc/arm-bcm2708-linux-gnueabi/4.7.1/cc1plus
/home/jayz/raspi/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/libexec/gcc/arm-bcm2708hardfp-linux-gnueabi/4.7.1/cc1plus
/home/jayz/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/libexec/gcc/arm-linux-gnueabihf/4.9.3/cc1plus
/home/jayz/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/libexec/gcc/arm-linux-gnueabihf/4.8.3/cc1plus
/home/jayz/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/libexec/gcc/arm-linux-gnueabihf/4.8.3/cc1plus
/usr/lib/gcc/x86_64-linux-gnu/7/cc1plus

so perhaps it’s a linker issue?

One thing that I have noticed is that I have no /usr/local/libexec or /usr/libexec directories but I am not sure if this is a problem or what it might imply.

Hi Stephen,
Thanks for your reply.
I tried again on the mac this evening. I attempted to rebuild the toolchain using your installer and also brew reinstalled a couple of the dependencies. I checked all the dependencies again using the commands mentioned. I trashed the repo and recloned it recursively using your command. I then cd’d into the seed/blink directory and ran the makefile directly from that directory and a couple of files of yours were not found by make. I took a look at your makefile I was wondering if the library paths should be actually the entire path not using ../../ .. Anyway here is the output I will take another look using vscode. Its late here and I have been writing python and sql all day at work so dont have a lot more appetite for screens :) script finishes like this

logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...none found.

[Process completed]


(base) seans-Mac-Pro:~ seanwayland$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

(base) seans-Mac-Pro:~ seanwayland$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(base) seans-Mac-Pro:~ seanwayland$ dfu-util --version
dfu-util 0.10

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2020 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

(base) seans-Mac-Pro:~ seanwayland$ openocd --version
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html

(base) seans-Mac-Pro:Desktop seanwayland$ git clone --recurse-submodules https://github.com/electro-smith/DaisyExamples ~/Desktop/DaisyExamples
Cloning into '/Users/seanwayland/Desktop/DaisyExamples'...
remote: Enumerating objects: 11965, done.
remote: Counting objects: 100% (3360/3360), done.
remote: Compressing objects: 100% (1224/1224), done.
remote: Total 11965 (delta 2235), reused 3141 (delta 2103), pack-reused 8605
Receiving objects: 100% (11965/11965), 949.38 MiB | 35.15 MiB/s, done.
Resolving deltas: 100% (8008/8008), done.
Checking connectivity... done.
Checking out files: 100% (3637/3637), done.
Submodule 'DaisySP' (https://github.com/electro-smith/DaisySP) registered for path 'DaisySP'
Submodule 'libdaisy' (https://github.com/electro-smith/libDaisy) registered for path 'libdaisy'
Cloning into '/Users/seanwayland/Desktop/DaisyExamples/DaisySP'...
Cloning into '/Users/seanwayland/Desktop/DaisyExamples/libdaisy'...
Submodule path 'DaisySP': checked out '6ad2e5928b1b0af924ae7e6cd23d08967acb8864'
Submodule path 'libdaisy': checked out '444d175ddda0a1f91b271cfe1b7eac4ff50d69ed'
(base) seans-Mac-Pro:Desktop seanwayland$ cd DaisyExamples
(base) seans-Mac-Pro:DaisyExamples seanwayland$ ls
DaisySP		README.md	cube		field		libdaisy	petal		rebuild_all.sh	seed		versio
LICENSE		ci		dist		helper.py	patch		pod		resources	utils
(base) seans-Mac-Pro:DaisyExamples seanwayland$ cd seed
(base) seans-Mac-Pro:seed seanwayland$ ls
Blink			Ram			atone			compressor		flanger			metro			pitchshifter		svf
Button			ReceiveTest		autowah			crossfade		fm2			modalvoice		pluck			synthbassdrum
Drum			SDMMC			balance			dcblock			formantosc		moogladder		port			synthsnaredrum
HWTest			USB_CDC			biquad			decimator		fractal_noise		nlfilt			resonator		tone
Knob			WavPlayer		bitcrush		delayline		grainlet		oscbank			reverbsc		tremolo
LCD_HD44780		adenv			blosc			drip			harmonic_osc		oscillator		samplehold		variableshapeosc
Logger			adsr			bypass			dust			hihat			overdrive		sampleratereducer	varisaw
OLED			allpass			chorus			experimental		jitter			particle		smooth_random		vosim
Osc			analogbassdrum		clockednoise		faustnoise		line			phaser			string			whitenoise
QSPI			analogsnaredrum		comb			fir			maytrig			phasor			stringvoice		zoscillator
(base) seans-Mac-Pro:seed seanwayland$ cd Blink
(base) seans-Mac-Pro:Blink seanwayland$ ls
Blink.cpp	Blink.sln	Makefile	README.md	vs
(base) seans-Mac-Pro:Blink seanwayland$ make -f Makefile
mkdir build
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard  -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000  -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER  -include stm32h7xx.h -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/src/sys -I../../libdaisy/src/usbd -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/DSP/Include -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libdaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libdaisy/core/ -I../../DaisySP/Source -I../../libdaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -MMD -MP -MF"build/startup_stm32h750xx.d" -std=gnu11 -Wa,-a,-ad,-alms=build/startup_stm32h750xx.lst ../../libdaisy/core/startup_stm32h750xx.c -o build/startup_stm32h750xx.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard  -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000  -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER  -include stm32h7xx.h -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/src/sys -I../../libdaisy/src/usbd -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/DSP/Include -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libdaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libdaisy/core/ -I../../DaisySP/Source -I../../libdaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -MMD -MP -MF"build/diskio.d" -std=gnu11 -Wa,-a,-ad,-alms=build/diskio.lst ../../libdaisy/Middlewares/Third_Party/FatFs/src/diskio.c -o build/diskio.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard  -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000  -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER  -include stm32h7xx.h -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/src/sys -I../../libdaisy/src/usbd -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/DSP/Include -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libdaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libdaisy/core/ -I../../DaisySP/Source -I../../libdaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -MMD -MP -MF"build/ff.d" -std=gnu11 -Wa,-a,-ad,-alms=build/ff.lst ../../libdaisy/Middlewares/Third_Party/FatFs/src/ff.c -o build/ff.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard  -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000  -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER  -include stm32h7xx.h -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/src/sys -I../../libdaisy/src/usbd -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/DSP/Include -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libdaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libdaisy/core/ -I../../DaisySP/Source -I../../libdaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -MMD -MP -MF"build/ff_gen_drv.d" -std=gnu11 -Wa,-a,-ad,-alms=build/ff_gen_drv.lst ../../libdaisy/Middlewares/Third_Party/FatFs/src/ff_gen_drv.c -o build/ff_gen_drv.o
arm-none-eabi-gcc -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard  -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000  -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER  -include stm32h7xx.h -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/src/sys -I../../libdaisy/src/usbd -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/DSP/Include -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libdaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libdaisy/core/ -I../../DaisySP/Source -I../../libdaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -MMD -MP -MF"build/ccsbcs.d" -std=gnu11 -Wa,-a,-ad,-alms=build/ccsbcs.lst ../../libdaisy/Middlewares/Third_Party/FatFs/src/option/ccsbcs.c -o build/ccsbcs.o
arm-none-eabi-g++  -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard  -DUSE_HAL_DRIVER -DSTM32H750xx -DHSE_VALUE=16000000  -DCORE_CM7 -DSTM32H750IB -DARM_MATH_CM7 -DUSE_FULL_LL_DRIVER  -include stm32h7xx.h -I../../libdaisy -I../../libdaisy/src/ -I../../libdaisy/src/sys -I../../libdaisy/src/usbd -I../../libdaisy/Drivers/CMSIS/Include/ -I../../libdaisy/Drivers/CMSIS/DSP/Include -I../../libdaisy/Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../../libdaisy/Drivers/STM32H7xx_HAL_Driver/Inc/ -I../../libdaisy/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I../../libdaisy/core/ -I../../DaisySP/Source -I../../libdaisy/Middlewares/Third_Party/FatFs/src -O2 -Wall -Wno-missing-attributes -fasm -fdata-sections -ffunction-sections -MMD -MP -MF"build/Blink.d" -fno-exceptions -fasm -finline -finline-functions-called-once -fshort-enums -fno-move-loop-invariants -fno-unwind-tables  -std=gnu++14 -Wa,-a,-ad,-alms=build/Blink.lst Blink.cpp -o build/Blink.o
arm-none-eabi-g++  build/startup_stm32h750xx.o build/diskio.o build/ff.o build/ff_gen_drv.o build/ccsbcs.o build/Blink.o   -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard --specs=nano.specs --specs=nosys.specs -T../../libdaisy/core/STM32H750IB_flash.lds -L../../libdaisy/build  -L ../../DaisySP/build -ldaisy -lc -lm -lnosys -ldaisysp -Wl,-Map=build/Blink.map,--cref -Wl,--gc-sections -o build/Blink.elf
/usr/local/Caskroom/gcc-arm-embedded/10-2020-q4-major/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: cannot find -ldaisy
/usr/local/Caskroom/gcc-arm-embedded/10-2020-q4-major/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: cannot find -ldaisysp
collect2: error: ld returned 1 exit status
make: *** [build/Blink.elf] Error 1
(base) seans-Mac-Pro:Blink seanwayland$ 

У меня проблемы с компиляцией .c а также .cpp файлы, использующие gcc а также g++В обоих случаях я получил сообщение:

g++(or gcc): error trying to exec 'cc1plus': execvp: No such file or directory`

Я уже пытался переустановить и GCC и g++ и будьте уверены, что они оба в одной версии.

Редактирование: Я использую Ubuntu 16.04.1 LTS, и g ++, и gcc находятся в версии 5.4.0 20160609.

Ниже приводится вывод echo | g++ -v -xc++ -fsyntax-only -:

Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
COLLECT_GCC_OPTIONS='-v' '-fsyntax-only' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
cc1plus -quiet -v -imultiarch x86_64-linux-gnu -iprefix ../lib/gcc/x86_64-linux-gnu/5/ -D_GNU_SOURCE - -quiet -dumpbase - -mtune=generic -march=x86-64 -auxbase - -version -fsyntax-only -o /dev/null -fstack-protector-strong -Wformat -Wformat-security
g++: error trying to exec 'cc1plus': execvp: No such file or directory

Вот и результат компиляции программы hello world с помощью gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
cc1 -quiet -v -imultiarch x86_64-linux-gnu -iprefix ../lib/gcc/x86_64-linux-gnu/5/ codigo.c -quiet -dumpbase codigo.c -mtune=generic -march=x86-64 -auxbase codigo -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/cckVKe9E.s
gcc: error trying to exec 'cc1': execvp: No such file or directory

Ниже приводится вывод /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus </dev/null:

Analyzing compilation unit
Performing interprocedural optimizations
<*free_lang_data> <visibility> <build_ssa_passes> <opt_local_passes> <free-inline-summary> <whole-program> <inline>Assembling functions:

Execution times (seconds)
phase setup             :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 (20%) wall    1408 kB (81%) ggc
phase parsing           :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 (20%) wall     318 kB (18%) ggc
parser (global)         :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 (20%) wall     302 kB (17%) ggc
TOTAL                 :   0.00             0.00             0.05               1746 kB

3

Решение

Что-то сломалось в вашем НКУ установка (читайте также о GCC переменные среды & специальные файлы).

Проверьте также вашу среду, обязательно избегайте любых GCC_EXEC_PREFIX переменные среды

Я бы предложил переустановить с уместность:

aptitude reinstall gcc-5 g++-5

(возможно, вам нужно заменить оба случая 5 от 6по крайней мере на более новых версиях Ubuntu)

Затем скомпилируйте hello world программа с gcc -v чтобы быть уверенным, что это работает.

1

Другие решения

Других решений пока нет …

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Arduino protocol error
  • Arduino lcd begin ошибка
  • C10d118 volvo ошибка
  • C10d115 ошибка вольво
  • C10d115 ошибка volvo

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии