Cannot run include files. Getting 'No such file or directory' for any include.

I am using an Arduino Due with Arduino 1.5.1r2 running Windows 7. I have installed the drivers and communication with the hardware works fine. However, whenever I try to make a reference to any include file (files that it was installed with or libraries I download and try), I always receive the same error:

No such file or directory

When I look at Sketch-Import Library, it shows a list of libraries I can reference. When I try those, I get the same error message.

For example, I want to use the servo.h file. When I try to reference this file as an include, I get the error message: No such file or directory.

Can someone offer me assistance in why any reference to an include file generates this error?

Do you have the same problems with 1.0.3?

Thanks for the reply.

According to the documentation here, the Due should download ver 1.5.1r2:

Should I use a different version?

I downloaded Arduino 1.5.1r2 on Win7/64 bit. All the examples I tried, including those that include header files compiled just fine.

For example, I want to use the servo.h file. When I try to reference this file as an include, I get the error message: No such file or directory.

Case matters, no matter how little it matters to microsoft.

Ok, so you had no problem running the Example code for servos? You can find the code I am referring to at Files - Examples - Starter Kit - p05_ServoMoodIndicator.

Did you install this version of Arduino in any particular path on your hard drive? It seems like the include files are referenced in a relative path, in which case this might be the issue.

I installed the Arduino software in a folder on root of my C: drive.

Thank you for your reply and any help would be appreciated.

Well, that's interesting. I don't have a Due, so I compiled for a Mega. That works just fine.

I just tried that example for the Mega, and it compiles. So, I tried compiling for the Due, even though I don't have one. It fails, just like it fails for you.

I think you need to move this to the Due part of the forum.

Thanks for reviewing this and I will move this to the Due part of the forum.

are you hitting the bug mentioned there ?

Nope, that is not the issue I am experiencing. Can someone else please try to run the sample under the Due setup and see if they experience the same error? Any help would be appreciated.

Thanks PaulS, your troubleshooting of toggling the Board from Mega to Due seem to have fixed the problem. I deleted the Arduino folder from my Documents area (seems to be created automatically by Arduino software I think) and then toggled the Board used from Due to Mega, then back to Due and re-compiled. It compiled the library files correctly and everything was working.

Certainly a bug in the software but I got it working.

Thanks!

Incredible how this problem does continue. I am able to get the program to compile. However, when I try to upload it via the Programming Port, it then claims it cannot find the very include file that I had the original problem with, server.h. If I change it to the Native USB Port, it compiles but then cannot upload. This Due is becoming quite frustrating!

I had a few problems using libraries with the Due. I do not think the servo library is compatible by default, but there is a modified copy floating around somewhere in this forum.

I cannot find the page where these files are hosted originally, but I have attached the two files I've been using to drive servo's on my Due.

I've been placing these files in the same folder as the sketch I'm working on, then typing

#include "servo.h"

as opposed to

#include <servo.h>

This way, once you save the sketch and reopen, it will open the servo.h file in another tab, and you can be sure you're using the modified version.

Hope this helps, Phil.

Servo.h (6 KB)

Servo.cpp (11 KB)

1 Like

contacttodd:
Incredible how this problem does continue. I am able to get the program to compile. However, when I try to upload it via the Programming Port, it then claims it cannot find the very include file that I had the original problem with, server.h. If I change it to the Native USB Port, it compiles but then cannot upload. This Due is becoming quite frustrating!

You should use Native USB to upload on Windows 7. Need to press the erase buttion for a few seconds before uploading.