Pages: [1]   Go Down
Author Topic: [Solved - stupid mistake] Can't get libraries to load with sketch  (Read 940 times)
0 Members and 1 Guest are viewing this topic.
UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure where to put this, so if I got it wrong I kindly ask a moderator or administrator to move it for me.

All of the sudden I'm having trouble with sketches not compiling if they #include various libraries. Specifically (among others), I can't get the Time.h library to work right.

I have no idea what's wrong. The libraries worked a week or two ago, and now they don't. Nothing has been moved, the files and folders are right where they've been all along.

Moreover, nothing has changed in the sketches themselves. Sketches that once compiled nicely no longer compile. I get error messages consistent with libraries not being included, such as:

error: 'time_t' was not declared in this scope

What's even more confusing is that I can't get them to work on either of two computers, one is a Mac, the other running Windows 7.

I did upgrade both to 1.0.5 within the last few weeks, but I'm not certain if that's what has caused the problem.

Any suggestions?
« Last Edit: July 14, 2013, 05:53:11 pm by Canyonero » Logged

UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As is almost always the case when I get so perplexed by something that I reach out for help, I get it working shortly afterward.

Both computers were referencing a folder on a network share that has sketches and libraries in it. Pointing it to a local folder seems to have solved the problem.
Logged

UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Back to the start...

I got the Mac working, but still can't get it to work on Windows. I've uninstalled and reinstalled twice, purging everything I can find during uninstalls (library folders, etc.)

Then I've reinstalled the program and the libraries I need. The IDE isn't loading them.

Any ideas?
Logged

UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still not working.

Anyone?
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you checked the IDE preferences and made sure it's pointed to the right path where the sketches and libraries are located?  I only ask because I too keep my sketches and third party libraries somewhere other than the default path.  But once set, when I install a new version of the IDE it picks up my preferences and I don't have to tell it each time where they are.
Logged

UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you checked the IDE preferences and made sure it's pointed to the right path where the sketches and libraries are located?  I only ask because I too keep my sketches and third party libraries somewhere other than the default path.  But once set, when I install a new version of the IDE it picks up my preferences and I don't have to tell it each time where they are.
Yes. They've all been pointed to the same folder on a file server. Changing it back to default fixed the Mac, but now the Windows machine doesn't work regardless of where I point the IDE, or where the libraries are stored. I even tried uninstalling, reinstalling, and copying the libraries to the default location.

And actually, my Windows machine is a Hackintosh, that dual boots to OS X. I did a fresh install of the Arduino IDE into OS X on the same machine and it doesn't work there either. While I don't know what the problem is, I strongly suspect a bug in the 1.0.5 software of some sort. Just asking in case I'm missing something.
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would think if it had a bug, more people would be pointing it out.  I'd say get rid of all the preferences files.  You may have uninstalled it, but it doesn't get rid of the preferences.txt file (on Windows) as that's in the user's AppData folder.  Reinstalling the IDE won't overwrite that file either.  You have to it manually.
Logged

UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would think if it had a bug, more people would be pointing it out.
I agree, that's why I'm asking for help. It just seems strange to me that I have the same problem on all but one computer, and OS doesn't seem to matter.

I'd say get rid of all the preferences files.  You may have uninstalled it, but it doesn't get rid of the preferences.txt file (on Windows) as that's in the user's AppData folder.  Reinstalling the IDE won't overwrite that file either.  You have to it manually.

I figured there was something like that somewhere that would survive an uninstall, but I just tried uninstalling and deleting that file and still can't get it to work. It also doesn't explain why I can't get it to work on a fresh install on my Hackintosh (OS X side of things) having never installed or used it there before, and using default configurations (libraries in default location).

I do appreciate your suggestions. This thread has been otherwise quiet, and I can't figure out how to make this work. Thanks.
Logged

Land of Oz
Offline Offline
Jr. Member
**
Karma: 3
Posts: 73
I dream in Assembler
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you still in the same situation where importing a library stops compilation or will the ide just not compile at all, using a basic file like say the example in the bare minimum Setup program ?
It's a bit hard trying to decipher your complaint.
Logged

UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Basic sketches compile just fine. If it has a library, any code that depends on the library returns errors. For example, when I use the Time library (Time.h), I get this error:

Quote
error: 'time_t' does not name a type

time_t IS a type, but of course it needs the library to know that.

The time library is installed, and has the proper #include in the sketch. In addition, it used to work just fine; same sketch, same libraries, same computer, same compiler, etc. It just stopped working about a week or two ago.
Logged

Land of Oz
Offline Offline
Jr. Member
**
Karma: 3
Posts: 73
I dream in Assembler
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you move the offending library .h, .c and whatever else is needed, into your user folder and get it to compile ?
I mean, move the files away from the default folders into your personal arduino files folder ?
Logged

UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you move the offending library .h, .c and whatever else is needed, into your user folder and get it to compile ?
I mean, move the files away from the default folders into your personal arduino files folder ?

No success. I've tried moving them to default, personal, and a few other places. At compilation it's as if those libraries aren't there.
Logged

UTC-5
Offline Offline
Jr. Member
**
Karma: 0
Posts: 99
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Total Facepalm! smiley-red smiley-zipper

The problem was that I reinstalled the Time library for some reason. I forgot that there are actually three different libraries in subfolders that need to be moved up to the main folder. Once I took care of that, everything now works as it should.

How embarrassing!
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12577
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I forgot that there are actually three different libraries in subfolders that need to be moved up to the main folder.

I wouldn't regard that as a face-palm on your part, just that the library was incorrectly packaged.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: