Sketch errors new in 1.6.7, was find in 1.6.5 r5


I just upgraded to 1.6.6 from 1.6.5 r5 and now not a single sketch I have will compile. I get many different types of errors:

  1. Random comment lines fail to compile with an errors. No method to the madness.
  2. Many libraries, including LiquidCrystal_ISC and AdaFruit unified. The exact code ran fine in previous versions from 1.06 on without issue until I got this one.

I did try to remove 1.6.7 and go back, but had all kinds of problems. I have backed up everything, wiped all the folders manually, copied the sketchbook back and reinstalled all of the libraries; something must be left over that I missed. So for now I moved over to another machine and installed 1.6.5 r5 and the same sketch compiles, uploads and runs without errors. The irony is that the only thing I had changed was a comment line in the sketch and it works fine in 1.6.5-r5. I was upgrading because that is what all the students are now downloading and wanted to be at the same level as them.

Any ideas or help would be greatly appreciated.

Here is a sample from one of my sensor sketches:

Arduino: 1.6.6 (Windows 10), TD: 1.26, Board: "Arduino/Genuino Uno"

WARNING: Spurious .git folder in 'Adafruit BMP085 Unified' library
WARNING: Spurious .git folder in 'Adafruit Unified Sensor' library
PondSensor0.3:99: error: 'POSITIVE' was not declared in this scope

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);


D:\download\Hardware\Arduino\Sketchbook\PondSensor0.3\PondSensor0.3.ino: In function 'void loop()':

PondSensor0.3:194: error: 'f' was not declared in this scope

float fhif = dht.computeHeatIndex(f, h);


PondSensor0.3:194: error: 'h' was not declared in this scope

float fhif = dht.computeHeatIndex(f, h);


PondSensor0.3:196: error: 't' was not declared in this scope

float fhic = dht.computeHeatIndex(t, h, false);


PondSensor0.3:206: error: 'clear' was not declared in this scope



PondSensor0.3:244: error: expected ';' before '}' token



exit status 1
'POSITIVE' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

Dirst, post errors in code tags please. And without the code we can't help you...

Btw, I doubt the sketch ever ran...


Will cause a problem in any compiler....

Sorry, couldn't get the code tags to work. No idea why but they're not working on Opera right now ....

And the code has run just fine for 2 years on more than 30 Uno's. I took the EXACT SAME ino file and it compiled and uploaded just fine on 2 other PC's (win 10 and uBuntu) to several new Uno's with 16..5-r5 BEFORE I posted this earlier.

As for the comma, it's not there in 1.6.5, but it sure is in 1.6.7 and my bad eyes couldn't see it. Sorry for the miss on my part. UPDATE: After digging with a hex editor, found out that there was a hex 0D (CR) or )a (LF) embedded just prior to the offending areas. Must have been done at some point in the past and the old IDE handled/removed it, but 1.6.7 doesn't. That's why the cut/paste trick works; hidden characters are removed. Of course it also explains the lines we couldn't delete. I've now learned that lots of people have had this problem, though I don't really consider it a bug, and we have no idea how they got there in the first place .....

BTW, I cannot post the code in its entirety because one of the authors (of a custom sensor) does not permit it in his license and I am obligated to honor that. I took over the project a year ago, and was asked to help to expand the project to encompass more sensors. As previously mentioned, all I did was update the comments to make certain anyone working on it was modifying the right code for their version of the sensor block.

I guess this is why the project head told me not to bother to post here; I'd just get chewed out. Sorry for wasting the time for you. I just wish people didn't get berated so much when asking for help. I'm glad I posted exactly the same info elsewhere; without some of that help this would not be getting resolved. And not one ill word was written.

After tinkering for much of the day, I have learned several things that suddenly appear to be problems, at least for my project, in the current IDE:

  1. At the suggestion of the staff of one of the Arduino and shield vendors, I simply copied (cut/pasted) the text from my sketch into a new sketch, and saved. This cured all but the "spurious git" warning and the POSITIVE constant error with Mr. Malpartida's excellent LCD I2C Library. Still don't have that one resolved. This would lead one to belive that there is either a problem with 1.6.7 reading, or 1.6.5 writing the sketch, no idea. But they were correct and it must have apparently removed some characters as the sketch (.ino) is now 4 bytes smaller. Hidden chars maybe? UPDATE: Hidden chars indeed. Spurious and POSITIVE errors remain.

  2. There appear to be features/issues introduced that are breaking some libraries in 1.6.7. This issue has been noted in many forums, though there does not appear to be a pattern, nor any sort of list of which may or may not be broken. I have contacted each of the authors to see if they have experienced errors with 1.6.7 and am awaiting responses. UPDATE: 2 of the library authors have confirmed that their libraries do not work at all in 1.6.7 and they have not yet fixed them. Interestingly, both of them are commercial sensor products. Another has stated that his library only appears to work on a clean install of 1.6.7 and he too has had "significant" issues when the IDE was updated. He is currently using 1.5.7 as were the bulk of us working on this project, until we unfortunately upgraded last week. The last stated simply that his does not work on 1.6.7. I have yet to receive a response from two more. So that is at least 4 of 14 third party libs taht appear to be somehow affected by this upgrade

  3. The same issues did not occur on the 1 machine I have that never had Arduino IDE installed prior to 1.6.7. So I am wondering if the issue is related to upgrading only? The compile fails on every upgraded machine I have access to, a total of 29. All of the machines worked fine with the sketch prior to the upgrade.

  4. Intermittently, I still get upload errors. No idea why, not just one machine.

  5. Single character variable names don't always work. There are a couple of other sketches that had the same issue, did the cut/past/save compile and suddenly they did .... These sketches both shrunk in size as well so maybe related to #1? UPDATE: After digging with a hex editor, found out that there was a hex 0D (CR) embedded just prior to the offending names. Must have been done at some point in the past and the old IDE handled/removed it, but 1.6.7 doesn't. That's why the cut/paste trick woks; hidden characters are removed.

I have no idea if this information is useful, but feel compelled to share the results of several very frustrating days in the hope that it does.


Perhaps it's a line terminator issue, where the IDE and compiler expects LF only, while Windows editors typically use CR/LF when saving files. Could be even worse on Mac, where AFAIR the terminator is LF.

Why did you update IDE?
I'm still using 1.6.5 and won't even think about updating for a month or more, why? Cos they haven't been fully tried yet.
I have 1.5 and all the way to 1.6.5 running on this WIN7 system without problems, I never remove old versions.

All libraries I get, I put in Documents/Arduino/Libraries, this makes them accessible by all versions of the IDE.

Your errors show you have are a LIBRARY problem, where are the libraries that you downloaded for those sketches?

Tom...... :slight_smile:

It sounded like he's a teacher, and all his students are downloading the new version.

Frankly, I think it's rather irresponsible of Arduino to keep the extremely buggy 1.6.6 and 1.6.7 versions front-and-center, while you have to dig for 1.6.5-r5 which actually works.

It's all well and good to promote the new versions to people who know what they're doing, but many people using Arduino are just learning, and we ought to point them to a version that isn't known to be full of bugs that the community doesn't really know how to fix yet.

Thanks all for the replies, sorry for being tardy, been shoveling my way out of the 30+ inches of snow we just got here in Central PA. I not have every single one working just fine on 1.6.5-r5

DrDiettrich - couldn't agree more, but no idea how they go there, since they compile unchanged in 1.6.5-r5.

TomGeorge - DrAzzy is on the right path. I helped develop a curriculum, and the students in those closes only have access to the most current version because they are given it prior to me ever meeting them. I came in to help when things started failing, only to find they weren't failing, the compiler was as they added/updated code. Each one builds one of these boxes when they start to get their feet wet, and we haven't changed a single character of code in more than a year. The libraries were imported with the library manaeger (I thought the same as you) and something isn't right with 1.6.6 and 1.6.7. And it appears that once they are installed on a PC, they are never completely remove except when done by hand, so I now have toughed 40+ computer for at least half and hour each to get them all to 1.6.5-r5 and now they all work. Didn't touch a single line of code, not one. For grins, I've updated every library in use to the most current version I could fine, and they all work fine with 1.6.5-r5. None of them work with any newer version. I have instructed all the instructors to ONLY use 1.6.5-r5 until I tell them otherwise. And we have lost a week of classes.

Dr. Azzy - Could not have said it better. But these are instructors that simply would not know that never is NOT better. To be truthful, in the past I would have said the same with Arduino, but no more, especially when it's on;y a point release I wish Atmel Studio wasn't so complicated for the typical Arduino user because IT ALWAYS works! :slight_smile: I too am immensely disappointed that Arduino would release and not pull these 2 terrible releases. I also wish that tehy would get more intelligent with version numbering; Changing over to Boards Manager and other such major changes warrant more than a point release to me, as I feel that they are major changes, but that's just me.

We all love what Arduino has done, but I'm starting to feel it slip away .....problems like these break confidence with those who approve because of the time lost that we can not get back .....