Error Compiling

I have been going round in circles and its driving me nuts. I cant seem to find where my error is. I would very grateful if someone out there can explain what I am doing wrong.

this is the error message I keep getting

Arduino: 1.6.3 (Windows 8.1), Board: “Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)”

Screens.ino:131:1: error: expected unqualified-id at end of input
Screens.ino:131:1: error: expected constructor, destructor, or type conversion at end of input
Multiple libraries were found for “LiquidCrystal.h”
Used: C:\Users\MP\Dropbox\ARDUINO\arduino-1.6.3\arduino-1.6.3\libraries\LiquidCrystal
Not used: C:\Users\MP\Dropbox\ARDUINO\arduino-1.6.3\arduino-1.6.3\libraries\LiquidCrystal_I2C
Not used: C:\Users\MP\Dropbox\ARDUINO\arduino-1.6.3\arduino-1.6.3\libraries\LiquidCrystal
Not used: C:\Users\MP\Dropbox\ARDUINO\arduino-1.6.3\arduino-1.6.3\libraries\LiquidCrystal_I2C
Error compiling.

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

AquArt_FTm_C.ino (3.47 KB)

Screens.ino (10.6 KB)

I would think that after 34 posts you'd know that you'll get better responses if you post your source code files using code tags as presented in Nick Gammon's guidelines found at the top of the Forum rather than making everyone copy your file onto their hard drive.

econojack, I think in this case, code tags vs attachment of the code really doesn't matter. I believe Nick's guidelines are more about posting code and when the code is inserted in the post, use the code tags. In this case the code was posted (which is the most important thing to do) and it isn't just a few lines so attaching it seems just fine.


This line looks very odd:

*/*void ScreenClock()

Almost looks like you might have been using comments instead of ifdefs to remove some code and got some mismatched comment identifiers. If so, it is much better to use

#ifndef notdef
// code you don't want'
#endif

instead.

Also, it looks like there are some potential issues with some LCD libraries. I'm guessing that the "LiquidCrystal" library is really something like fm's library and so the LiquidCrystal_I2C library is conflicting with it. I don't think this is what is causing this issue; however, the library issue should remedied as it can cause issues and potential compile issues.

--- bill I

Bill thanks a lot for that. Sharp eye there. Sometimes it takes a fresh eye to notice the smallest of things. Mariano

@bill: I think attaching code should be used when the source file is too large for code tags. Personally, I don't like downloading someone's code for a number of reasons. First, it's an unnecessary step in most cases. Second, I really don't like downloading files that I am not absolutely sure of its content. Finally, I do believe the OP will get more responses if he posts the code, rather than attach it (if it's not too big) for download.

@comeback do I assume I did the right thing then to attach as the sketch in question was over 300 lines?

…do I assume I did the right thing then to attach as the sketch in question was over 300 lines?

I think that, if you try to attach the file and you receive a message that it’s too large for code tags, that’s when you attach it. Otherwise, I’d just use the code tags.

Proietti:
@comeback do I assume I did the right thing then to attach as the sketch in question was over 300 lines?

I think if you’ve let it get to 300 lines before fixing a trivial typo, then your fault-finding technique needs a rework.

econjack: I think that, if you try to attach paste the file into a post using code tags and you receive a message that it's too large for code tags, that's when you attach it. Otherwise, I'd just use the code tags.

I agree with the sentiment, with a minor adjustment for clarity. I'm sure this is what you meant to say, but it was confusing using "attach" with two different meanings. ;)

Guys, I think you are being way too rough on the guy. He posted the full code to the module that was having the issue which is the most important thing. Accidentally creating a typo like this that not obvious or easy to accidentally to overlook is easy to do, particularly since the error(s) reported is unlikely to be on line where the error actually is.

Also, when there are typos or sometimes even valid code that the IDE chokes on vs the compiler, it is seldom in tiny little small code modules and often it is not as the file is slowly growing but after a editing session once the file is already a substantial size.

I've had MANY issues where the IDE chokes on perfectly valid code and I have to start doing a binary search using ifdefs to isolate where the problem is. Once located I can massage the code to work around the bugs in the IDE parser to allow the IDE to parse the code before it hands it off to the compiler.

In terms of which is easier to deal with: code in a code tags bock vs code that has been attached as file.

I don't think it really matters much. However in practice, I find just the opposite from econjack's comments. I'd rather have the code file attached, particularly if it is more than just a few lines. (My view of "just a few lines" is more than can can be fully seen at once in the post, which is typically less than about 20) When the code starts to get to be more than about 10-20 lines I want the code in an editor when I can do searches, have syntax highlighting, and other capabilities. This makes things much easier when trying to locate things like missing parrens or brackets, or nested comments. The reason I consider having an attached file easier is that a browser can be set up so it asks what to do with the file: save it or do something else. (I have mine set up this way) When selecting something other than saving, I can specify whether I want to bring up the .ino file directly into the IDE or my text editor. If it is in code tags I have to select the code block, then copy it, then bring up the editor, then paste it into the editor or into a blank IDE sketch.

I'd rather have the original file than some cut/pasted text that has gone through several iterations of mutations from being cut/paste and might not be the full code in the module. I've seen cases in these types of compiler error posts where you see that only a portion of the original file has been posted using code tags and the portion of the code posted is not the portion causing the error. And so the thread bounces around a while while trying to get the OP to post the rest of the file. It would have been much easier and quicker if the entire original file had been posted.

So from my perspective and experience with these types of threads, having the full code to a module as an attachment can actually be easier to deal with.

--- bill

bperrybap: So from my perspective and experience with these types of threads, having the full code to a module as an attachment can actually be easier to deal with.

That's your opinion, and everyone has one.

Personally, I find it much easier to read code when it's in the post. On the rare occasion where I want to look at it in an editor, so I can do searches or other manipulations (like clean up someone's totally unformatted code so I can see the structure) then it's less work to click select and copy than it is to download and open a file the dozens of other times when I don't need it in an editor.

In addition, trying to read an attached file is a much more difficult situation when using a phone or tablet - none of my mobile devices know what a .ino file is or how to open it - reading the code is a matter of tapping the link, then a couple more taps to indicate which app to use, then going to the general file browser app and renaming it to .txt, then finally opening the file. I (and others) spend a significant amount of our forum time using a tablet - certain features of the forum are difficult enough on a tablet, not having the code in-line in the post makes it that much more difficult. If I'm on my tablet, and I see someone asking for help and the only way to see what they're doing is to download a file - I will simply move on the next topic, as it's simply not worth the effort.

If I'm on my tablet, and I see someone asking for help and the only way to see what they're doing is to download a file - I will simply move on the next topic, as it's simply not worth the effort.

Amen.

ShapeShifter: If I'm on my tablet, and I see someone asking for help and the only way to see what they're doing is to download a file - I will simply move on the next topic, as it's simply not worth the effort.

That isn't what happened here on this thread with other posters. They were flaming the OP for posting his code as an attachment vs inline and attacking his skillset including after the issue was resolved with the 2nd response and his confirmation in the 3rd response. Also keep in mind that in Nick's "How to use this Forum" sticky, in step #8 titled: "You can add attachments" it states:

If your code is too long to fit into a post, or you have multiple files ...

And in this case the OP did have multiple files.

If those that don't like attached files had simply moved on instead of complaining to/about the OP then this thread would have been much shorter, cleaner, and remained on topic.

I've got think skin and have no issues dealing with people in forums; however not everyone is built that way, which is why I was disappointed with AOL's comment in post #7. That was not constructive and was not helping move things forward - and it was after the issue had been resolved.

--- bill

bperrybap: If those that don't like attached files had simply moved on instead of complaining to/about the OP then this thread would have been much shorter, cleaner, and remained on topic.

Amen to that.

econjack: I would think that after 34 posts you'd know that you'll get better responses if you post your source code files using code tags as presented in Nick Gammon's guidelines found at the top of the Forum rather than making everyone copy your file onto their hard drive.

OT , with an apology to OP, but few observations on thread (comments) I would normally ignore.

It is not a matter of everyone copy your file onto their hard drive. It is a matter of econojack showing off with his wisdom and complaining, as he has done many times, without a SINGLE contribution to the subject. ( If you can't stand the heat , get out of the kitchen.)

Even his post count was incorrect.

Unfortunately recently there are WAY TO MANY posts "discussing bicycle sheds" instead of helping with Arduino programming, as already mentioned elsewhere, but I find it worth repeating.

Pf 2016

without a SINGLE contribution to the subject.

You are certainly an expert on that!

It is a matter of econojack showing off with his wisdom and complaining, as he has done many times, without a SINGLE contribution to the subject.

Really? I just get tired of reading posts where the OP has, in this case, made dozens of posts but still doesn't follow the guidelines Nick has suggested. If you re-read all of my posts, you'll see that I'm pretty gentle with Op's who only have a couple of posts and I politely suggest they read Nick's stickies. If they've made more that a dozen posts, I still suggest they read Nick's stickies, albeit perhaps a little more forcefully.

If I've never made a single contribution to the subject, how did I get over 200 karma points?

Vaclav: Unfortunately recently there are WAY TO MANY

sp. "WAY TOO MANY"