Pages: [1]   Go Down
Author Topic: Cannot run include files. Getting 'No such file or directory' for any include.  (Read 4295 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have the same problems with 1.0.3?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply.

According to the documentation here, the Due should download ver 1.5.1r2:
http://arduino.cc/en/Main/Software

Should I use a different version?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/en/Main/SoftwareDue

are you hitting the bug mentioned there ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 - downloaded 42 times.)
* Servo.cpp (11.02 KB - downloaded 50 times.)
« Last Edit: January 04, 2013, 10:00:16 am by mrp1p » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: