I get the following compilation errors which do not relate to the files indicated.
In file included from MSFTimeSetter.cpp:17:
/home/ian/Arduino-1.0/libraries/RTClib/RTClib.h:17: error: expected unqualified-id before '/' token
/home/ian/Arduino-1.0/libraries/RTClib/RTClib.h:17: error: expected ')' before '/' token
/home/ian/Arduino-1.0/libraries/RTClib/RTClib.h:17: error: expected ')' before '/' token
/home/ian/Arduino-1.0/libraries/RTClib/RTClib.h:17: error: expected ')' before '/' token
I have found similar issues in the old forum, but the solutions offered do not appear to apply.
I am using Mandriva Linux and got the same issue in Arduino 0022
Previous successful sketches have used SD, Wire ,RTClib and LiquidCrystal in various combinations.
The one in question is using Wire, RTClib and MSFTime which includes wiring and Time .
Tim
This code is C++ declaration code so you do not have to specify the implementation.
I copied this code in eclipse and eclipse says the code is fine.
To say anything useful we need more code.
Best regards
Jantje
I was not aware we were dealing with Eclipse. This declaration throws an error in IDE V0022 and V1.0:
uint8_t dayOfWeek() const;
This doesn't:
uint8_t dayOfWeek();
This is normally the error generated when a define tries to replace a function declaration. The function declaration becomes invalid (malformed) after the define. Maybe in this case, is is malformed without the define?
In file included from MSFTimeSetter.cpp:17:
/home/ian/Arduino-1.0/libraries/RTClib/RTClib.h:17: error: expected unqualified-id before '/' token
/home/ian/Arduino-1.0/libraries/RTClib/RTClib.h:17: error: expected ')' before '/' token
/home/ian/Arduino-1.0/libraries/RTClib/RTClib.h:17: error: expected ')' before '/' token
/home/ian/Arduino-1.0/libraries/RTClib/RTClib.h:17: error: expected ')' before '/' token
Tim
I'm all puzzled now.
As the code was only a snippet I put it into eclipse to see what the compiler says. I never assumed the project was compiled in eclipse.
I have never seen any difference between my eclipse plugin and the arduino and there shouldn't be any as they use the same compiler and same compiler sequence and same compiler options (except for I specify explicit C++ compilation, but that is irrelevant here)
As you sure know, having const behind a function means you can not change the value of members in the function. Therefore it only involves code verification and no translation activities.
So I'm really surprised this throws an error in Arduino 22 and 1.0 (and not 23?).
The environment I used was using Arduino 23 so that does not invalidate your statement nor mine :).
I just tried RTCLib from adafruit and it works fine in eclipse with Arduino 1.0.
I come to the same conclusion "To say anything useful we need more code."
Best regards
Jantje
Tim
I checked your code snippet. You are right It gives a problem in 23 1.0 using the Arduino IDE and it gives a problem in eclipse using Arduino library 23 (and I assume 1.0 as well).
So it is consistent between Eclipse and Arduino 8).
So your input puzzled me (thanks for that). I needed some thought about it and now I understand why. It is a typical context problem. So everybody thinks he is right and the others are wrong but everybody makes sense in a different context.
The code snippet doesn't make sense to the compiler. (out of the context of a class)
uint8_t testFunct() const;
Const means your object will not change. As this method is not linked to an object it doesn't make sense.
If you place the snippet in the context of a class it makes perfect sense.
class tt {
public :
uint8_t testFunct() const;
};
If you try this code snippet it works in Arduino ID E 23 1.0 and eclipse using 23 and 1.0.
Edders code was in the context of a class so his code is OK.
I can stick to my conclusion "To say anything useful we need more code."
best regards
Jantje
PS Note that the compiler used in Arduino is not known for his "comprehensive explanations" in case of errors.
I found that in Time.h there is a #define that interact with a function in the DateTime class in RTClib.h
in RTClib.h line 17 there is : uint8_t dayOfWeek() const ;and in Time.h of the arduino Time library #define dayOfWeek(_time_) ((( _time_ / SECS_PER_DAY + 4) % DAYS_PER_WEEK)+1) //
and this is why you have the error on line 17.
A solution could be to not use the time library or to modify one of the two libs.
Here is the way i did : I renamed the function dayOfWeek() to dayOfWeek2() in
RTClib.h line 17: uint8_t dayOfWeek2() const ;and in RTClib.cpp line 113: