OK, I understood and implemented your suggestions, but the code is not compiling.
I will post the code separately on GitHub https://github.com/ANGUSsugna/SEEN/find/main; the error messages are attached below but the short version is this:
First, I'm getting the following error with respect to the "PageLinks":
for example:
'Room2doors' redeclared as different kind of symbol .
I thought the problem might be that the #define room2doors.h had the same name as the room2doors page name, so I changed the names of the PageLinks by varying capitalization to Room2doors. Unfortunately this did not work.
Re-reading the error code I understood that the problem is that the enum function is defining them as pages whereas, in the -LinkPage name-.h files the code starts with void LinkPage name(){
OK, it can't be an "enum" and a "void", I understand that's a conflict. But how to resolve it?
I tried removing "void" but that did not work.
I tried replacing "void" with enum -LinkPage (), but that did not work.
I tried replacing "void" with page -LinkPage () , but that did not work.
I tried replacing "void" with displayImage -LinkPage (), but that did not work.
I tried replacing "void" with display -LinkPage (), but that did not work.
I tried replacing "void" with int -LinkPage (), but that did not work.
I tried replacing "void" with const int -LinkPage (), but that did not work.
So that's the first category of error, and my efforts to resolve it. The two books I've borrowed from the library (Sam's Teach Yourself Arduino Programming, and Arduino Sketches, Tools and Techniques for Programming Wizardry) don't even list enum in the index! So I've run out of permutations to try to resolve this conflict. I understand the basic problem, I just don't see what avenues are left to explore...
The second error is:
too many initializers for 'const int [20][4].
This is error is even more problematic for me because the number of constant integers appears to be correct! There are not too many initializers: there are 20 PageLinks and 4 directional buttons. What's the problem?
Related to this last is one more main category of error:
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
Googling this leads to forum discussions regarding C and C++ which are so far above my level of comprehension I haven't done more than skim them.
Once again, I'd appreciate any help.
Arduino: 1.8.16 (Windows Store 1.8.51.0) (Windows 10), Board: "Seeeduino XIAO, Arduino, Off"
GFX_SEEN-post-help5:64:13: error: 'Room2doors' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:39:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\room2doors.h:1:11: note: previous declaration 'const int Room2doors()'
const int Room2doors(){
^~~~~~~~~~
GFX_SEEN-post-help5:64:25: error: 'TwoDoors' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:40:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\twoDoors.h:2:11: note: previous declaration 'const int TwoDoors()'
const int TwoDoors(){
^~~~~~~~
GFX_SEEN-post-help5:64:35: error: 'SofaWall' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:41:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\sofaWall.h:2:11: note: previous declaration 'const int SofaWall()'
const int SofaWall(){
^~~~~~~~
GFX_SEEN-post-help5:64:45: error: 'Library' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:42:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\library.h:1:11: note: previous declaration 'const int Library()'
const int Library(){
^~~~~~~
GFX_SEEN-post-help5:64:54: error: 'fourthwall' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:43:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\fourthWall.h:2:11: note: previous declaration 'const int fourthwall()'
const int fourthwall(){
^~~~~~~~~~
GFX_SEEN-post-help5:64:66: error: 'book' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:44:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\Book.h:1:11: note: previous declaration 'const int book()'
const int book(){
^~~~
GFX_SEEN-post-help5:64:72: error: 'Lounger' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:45:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\lounger.h:1:11: note: previous declaration 'const int Lounger()'
const int Lounger(){
^~~~~~~
GFX_SEEN-post-help5:64:89: error: 'hall' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:47:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\HALL.h:1:11: note: previous declaration 'const int hall()'
const int hall(){
^~~~
GFX_SEEN-post-help5:64:106: error: 'blankWall' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:49:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\BLANKWall.h:1:11: note: previous declaration 'const int blankWall()'
const int blankWall(){
^~~~~~~~~
GFX_SEEN-post-help5:64:117: error: 'Mirror' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:50:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\mirror.h:1:11: note: previous declaration 'const int Mirror()'
const int Mirror(){
^~~~~~
GFX_SEEN-post-help5:64:135: error: 'Eye1' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:52:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\eye1.h:1:11: note: previous declaration 'const int Eye1()'
const int Eye1(){
^~~~
GFX_SEEN-post-help5:64:141: error: 'Eye2' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:53:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\eye2.h:1:11: note: previous declaration 'const int Eye2()'
const int Eye2(){
^~~~
GFX_SEEN-post-help5:64:147: error: 'Eye3' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:54:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\eye3.h:1:11: note: previous declaration 'const int Eye3()'
const int Eye3(){
^~~~
GFX_SEEN-post-help5:64:153: error: 'booK1' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:55:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\book1.h:1:11: note: previous declaration 'const int booK1()'
const int booK1(){
^~~~~
GFX_SEEN-post-help5:64:160: error: 'booK2' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:56:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\book2.h:1:11: note: previous declaration 'const int booK2()'
const int booK2(){
^~~~~
GFX_SEEN-post-help5:64:167: error: 'booK3' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:57:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\book3.h:1:11: note: previous declaration 'const int booK3()'
const int booK3(){
^~~~~
GFX_SEEN-post-help5:64:174: error: 'SofaDetail' redeclared as different kind of symbol
enum pages {Room2doors, TwoDoors, SofaWall, Library, fourthwall, book, Lounger, daGGer, hall, arrowwall, blankWall, Mirror, LipStick, Eye1, Eye2, Eye3, booK1, booK2, booK3, SofaDetail, NUMBER_OF_IMAGES} page;
^~~~~~~~~~
In file included from C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:58:0:
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\sofaDetail.h:1:11: note: previous declaration 'const int SofaDetail()'
const int SofaDetail(){
^~~~~~~~~~
GFX_SEEN-post-help5:94:1: error: too many initializers for 'const int [20][4]'
};
^
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
GFX_SEEN-post-help5:94:1: error: invalid conversion from 'const int (*)()' to 'int' [-fpermissive]
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino: In function 'void setup()':
GFX_SEEN-post-help5:123:8: error: cannot convert 'const int()' to 'pages' in assignment
page = Room2doors; // Initial page
^~~~~~~~~~
GFX_SEEN-post-help5:124:1: error: 'displayImage' was not declared in this scope
displayImage(page);
^~~~~~~~~~~~
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino:124:1: note: suggested alternative: 'display'
displayImage(page);
^~~~~~~~~~~~
display
C:\Users\patte\Documents\Arduino\GFX_SEEN-post-help5\GFX_SEEN-post-help5.ino: At global scope:
GFX_SEEN-post-help5:127:1: error: expected declaration before '}' token
}
^
exit status 1
'Room2doors' redeclared as different kind of symbol
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.