Missing GCC compiler error

Hi,

I am doing R&D on a Teensy 4.1 on Arduino IDE 2.2.0. When I try to compile anything I always get this error :

arm-none-eabi-g++: fatal error: cannot execute 'cc1plus': CreateProcess: No such file or directory

I have installed Teensy board extension, I also have installed the GCC compiler separately and set it to the system PATH variable (CMD screenshot verifies that)

I tried reinstalling whole Arduino IDE after the GCC installation, but it did not help

When I pick a different board: Uno, Nano etc. it still does not compile.

I feel like I am missing something, any ideas?



Hi @vilius00. I'm going to ask you to post the full verbose output from a compilation.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
  3. Click the OK button.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to fail.
  6. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the COPY ERROR MESSAGES button on that notification.
  7. Open a forum reply here by clicking the Reply button.
  8. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  9. Press Ctrl+V.
    This will paste the compilation output into the code block.
  10. Move the cursor outside of the code tags before you add any additional text to your reply.
  11. Click the Reply button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the Reply button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:
    Upload icon on toolbar
    A dialog will open.
  6. In the dialog, select the .txt file you saved.
  7. Click the Open button.
  8. Click the Reply button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

Which version of Teensy board did you install?

As was suggested, I always build with verbose settings turned on, as it shows you the actual commands that are being executed.

I could be wrong, but I don't think the Arduino build process will try to use the compilers found on your system path. Instead, I believe it uses the data in the teensy install: platform.txt

If it were me, my next steps would be to try something like:
a) Uninstall Teensy board in the IDE.
b) exit the IDE and or be real safe and reboot.
c) make sure everything of the teensy install is removed.
Delete or move the directory: C:\Users\kurte\AppData\Local\Arduino15\packages\teensy
(obviously your path will likely be different)

c1) optional - remove a bunch of the Arduino cache stuff, like I might delete:
C:\Users\kurte\AppData\Roaming\arduino-ide

c2) Optional - clear out a bunch of stuff out of temp:
C:\Users\kurte\AppData\Local\Temp\arduino
maybe also *.clangd
...

d) start up the Arduino IDE and reinstall the Teensy board, choosing the version you wish to use.
I am using the newer beta 0.59.3

And then hopefully things will compile

A little update:

I tried reintalling the IDE itself, did not work...

I tried removing the teensy package from the IDE, deleting all the associated files, rebooting... Everything like you have said.

I did this procedure couple of times trying several different teensy versions including the 59.3 and 1.58.1 (latest by the time of this post), I still get the exact same error

compilation terminated.
C:\Users\Svečiai\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\11.3.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=159 -DARDUINO=10607 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\Users\Svečiai\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.3\cores\teensy4 C:\Users\Svečiai\AppData\Local\Temp\arduino\sketches\9C48B9DEFFA06E95AA989C0725220A37\sketch\sketch_sep4a.ino.cpp -o nul

type or paste code here

Dont know if it makes any difference, but after digging into the teensy directory I can find a arm-none-eabi-g++ file (it is mentioned in the error message), so despite the error, the file actually is present...

With 1.57.2 version installed, the error message is slightly different:

QBN: teensy:avr:teensy41
Using board 'teensy41' from platform in folder: C:\Users\Svečiai\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.57.2
Using core 'teensy4' from platform in folder: C:\Users\Svečiai\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.57.2

Detecting libraries used...
arm-none-eabi-g++: error: C:\Users\Sveciai\AppData\Local\Temp\arduino\sketches\179C9830CA381550182E20FFBC3A5CBE\sketch\sketch_sep4a.ino.cpp: No such file or directory
arm-none-eabi-g++: warning: '-x c++' after last input file has no effect
arm-none-eabi-g++: fatal error: no input files
compilation terminated.
C:\Users\Svečiai\AppData\Local\Arduino15\packages\teensy\tools\teensy-compile\5.4.1/arm/bin/arm-none-eabi-g++ -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=10607 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\Users\Svečiai\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.57.2\cores\teensy4 C:\Users\Svečiai\AppData\Local\Temp\arduino\sketches\179C9830CA381550182E20FFBC3A5CBE\sketch\sketch_sep4a.ino.cpp -o nul
Alternatives for no input files: []
ResolveLibrary(no input files)
  -> candidates: []

exit status 1

Compilation error: exit status 1

Just a wild guess, but my teensy 4.1 is running an ARM Cortex M7, but in the logs I can only find ,,AVR" named folders etc. Why is that so? Could it be that teensy board library does not include arm based applications (just a guess, dont take too serious)

With this one, it looked like there was some cleanup of your temp directory and the temp version of your sketch was gone...

Try exiting and start up the IDE again and load up a sketch and see if works any better.

This is normal for Teensy builds. They are all defined under: \packages\teensy\hardware\avr
Why?
At least in the early days of Teensy 3.x, it was hard to get library developers to take in change requests to support non AVR based boards. So Paul did lots of stuff to make them as compatible as possible with AVR boards... And he stuck to it.

Seems that the fix was rather unusual... I just switched from a guest windows user to admin, and the compiler started working... You can never know...

I meant to ask you yesterday if you had permissions. But did not as you did all of the stuff to install and uninstall stuff, so then assumed you must have permissions.

Glad you got it running

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.