Pages: [1]   Go Down
Author Topic: Strange problem with library...  (Read 274 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am working on a library that was working fine yesterday evening but I wanted to change the name so first I backed up the whole library folder by selecting it and zipping it up and then messed with it but kept getting errors so I deleted the folder and reverted to the backup by unzipping the folder back to it's original place (this is a quick backup method I use regularly)

BUT

I am now getting errors which are silly!

This is an example of a call on the current version of the library:

Code:
DueGUI.addPanel(0,0,799,50,clrBlue,clrWhite,clrWhite,2,"Board   control   menu",280,8,BVS_34,visible,URNnull);
The final attribute "URNnull" was added yesterday but it was working for hours after being added....

Following being restored from the backup I am now getting the errors (actually I am getting pages of errors in pairs for each call, this is the pair relating to the 1st error):

Code:
/Users/darren/Documents/Arduino DUEGUI/libraries/UTFT/UTFT.h:294: error: expected ',' or '...' before numeric constant
AND

Code:
DueGUI_demo_01:178: error: no matching function for call to 'UTFT::addPanel(int, int, int, int, int, int, int, int, const char [23], int, int, int, int, int)'
/Users/darren/Documents/Arduino DUEGUI/libraries/UTFT/UTFT.h:301: note: candidates are: int UTFT::addPanel(word, word, word, word, long int, long int, long int, byte, String, int, int, int, bool)

My call in the sketch is calling "addPanel" with 8 ints a string and 5 ints BUT the compiler thinks that the corresponding line in the h file only has 8 ints, a string and 4 ints......

It DID the day before but since last night it has had 5 ints following the string.

The actual line in the h file is:


  int     addPanel(word x,word y,word xs,word ys,long colour,long borcolour,long textcolour,byte borwidth,String top,int xo,int yo,int font,bool visible,int URN);


and the corresponding line in the cpp file is:


int UTFT::addPanel(word x,word y,word xs,word ys,long colour,long borcolour,long textcolour,byte borwidth,String top,int xo,int yo,int font,bool visible,int URN){


This makes no sense as it all worked before.....


So I installed the IDE on another fresh computer this time running Windows7 rather than MacOS and with a completely fresh install I get the SAME issue!

I thought that it might be looking at an old file but if I go to the latest h file and insert a lot of lines before the error the line number of the error increases so the IDE is looking at the right file.


IF I remove the final attribute from the definition in the sketch, h file and in the cpp file the first error:

/Users/darren/Documents/Arduino DUEGUI/libraries/UTFT/UTFT.h:294: error: expected ',' or '...' before numeric constant

Stays but the other one goes away.....


This was working perfectly earlier and it's not now....  I cannot understand what on earth is wrong with it.
Logged

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

I have exactly same error that you.

In DUEGUI example, there are an error:

"extern uint8_t SmallFont[];
#include "SPI.h"
#include <UTFT.h>
UTFT TFT1(CTE70,25,26,27,28); "

Correct form:

"extern uint8_t SmallFont[];
#include "SPI.h"
#include <UTFT.h>
DUEGUI TFT1(CTE70,25,26,27,28); "

But if apply this change, addPanel have one more arguments.

If you and I solve this problem, please, report in this thread.

Thanks a lot.
Carlos
Logged

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

Well, I think that I have a solution.

In DUEGUI ZIP, there are two sample files:

DueGUI_demo.ino that no work correctly (+1 argument extra in prototipe function .h) and

Code:
and DUEGUI DueGUI(CTE70);   // which is: DUEGUI TFT1(CTE70,25,26,27,28);

in incorrect form.

But inside ZIP file, there are other example DueGUI_demo2.ino that works ok.

I don't know why this two example files, one works and other don't work. but I'm compiled second file and 0 errors have done.

Thanks
Logged

Pages: [1]   Go Up
Jump to: