Arduino IDE and Teensy 4.1

This may be old info, but I have not been able to locate anything on the forums...specific to the Teensy 4.1.

I have the Teensy add-0n added to my Arduino IDE 1.8.13.
Right now I am just trying to upload the Blink code from the examples, and I get an error;

bits/c++config.h no such file directory FATAL ERROR

code *************************************8

#include <Arduino.h>
#include "TeensyThreads.h"

const int LED = 13;

volatile int blinkcode = 0;

void blinkthread() {
while(1) {
if (blinkcode) {
for (int i=0; i<blinkcode; i++) {
digitalWrite(LED, HIGH);
digitalWrite(LED, LOW);
blinkcode = 0;

void setup() {
pinMode(LED, OUTPUT);

int count = 0;

void loop() {
blinkcode = count;

If I select a Teensy 3.0, the code compiles without error.
Can someone enlighten me pls?

My internet searches indicated I should locate the arduino15 directory and delet everything from it and restart my computer and the IDE....and all should be OK....
I tried this with no success....
I have deleted and reinstalled arduino IDE 1.8.13 and reinstalled the Teensyduino.... no success

Help needed....

I see a report of this error being caused by having the CPLUS_INCLUDE_PATH environment variable set:

Unfortunately, I have not been able to reproduce the issue, even after setting that variable.

Anyway, if you do have it set, removing it is worth a try.

OK, I am now able to reproduce the issue. So I am more suspicious that CPLUS_INCLUDE_PATHis the cause of your error.

If you don't know how to remove it, you should tell us which operating system you are using, since the instructions for doing that are different from one to the other.

Sorry I forgot to include the operating system.
I am using Windows 10 Enterprise
and yes, please advise the correct steps to remove

Do this:

  1. Right click the Windows Start button.
  2. From the menu, click "Run".
  3. In the "Open" field, type "SystemPropertiesAdvanced".
  4. Click the OK button. The "System Properties" window will now open.
  5. Click the "Advanced" tab.
  6. Click the Environment variables... button.
  7. In the "System Variables" list, you should see "CPLUS_INCLUDE_PATH ". Click on it.
  8. Click the Delete button.
  9. Click the OK button.
  10. Click the OK button on the "System Properties" window to close it.

Now try compiling again. Hopefully the error will be fixed.

"CPLUS_INCLUDE_PATH " in not listed and an Environment variable in the system properties.

That's unfortunate. It was worth a try anyway.

Pert, I do appreciate your assistance.
After many hours of searching, searching again... I decided to google "where can I get config.h" and one of the links came back as: GitHub - psp2sdk/libs: Libraries for PSP2
I downloaded the ZIP file, extracted it, and copied the contents of its "BITS" subdirectory to my existing "arduino-1.8.13\hardware\tools\arm\arm-none-eabi\include\c++\5.4.1\bits" directory and it now works. The config.h is not the only file that was missing, and thats why I copied the entire directory to mine.
Good news is that this resolved my issue.

1 Like

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