MATLAB: When connecting to an Arduino board, how to fix errors that point towards the “c++config.h” file

Embedded Coder

I have an Arduino board that I am trying to use from MATLAB. When I try to connect to it using the following command:
>> arduino();
I get a lengthy error message that ends with the "c++config.h" file, and "No such file or directory" or similar. How do I fix this?

Best Answer

  • There are several steps that we can take to get past these types of errors.
    1) Reinstall the Arduino IDE, and install your specific Device support from the Arduino IDE.
    2) Then, please work through the Arduino Hardware Troubleshooting steps here:
    3) In the error that points to the "c++config.h" file, find the entire directory where that file is. It will look something like this:
    Copy the contents of the above folder (..\bits\) to this folder:
    In essence we are removing these folders (or similar, intermediate, repeated folders) from the file path:
    Then restart MATLAB and run the connection command again. The board should connect successfully.