Greg Ercolano wrote:
> [..] the error seems to be happening as part of an #include from
> Fl_Printer.H
> (which is I think one of the new files), because the error says:
>
> In file included from ../FL/Fl_Printer.H:6,
> from Fl_cocoa.mm:2988,
> from Fl.cxx:1516:
> ../FL/Fl_Pixmap.H: In constructor `Fl_Pixmap::Fl_Pixmap(char* const*)':
> ../FL/Fl_Pixmap.H:68: error: parse error before `;' token
Just casually tracing through the #include paths:
1) Fl.cxx (a C++ file) seems to include..
2) Fl_cocoa.mm (an Objective C file), and during an "@implementation
FLaboutItemTarget" it includes..
3) Fl_Printer.H (a C++ file) which includes Fl_Device.H and fl_draw.H,
and then includes..
4) Fl_Pixmap.H which begins defining Fl_Pixmap, and fails on the first
"explicit" constructor
method that includes a code implementation.
The error happens on this line:
explicit Fl_Pixmap(char * const * D) : Fl_Image(-1,0,1), alloc_data(0),
myid(0), mymask(0) { set_data((const char*const*)D); measure(); }
So I decided to break that line out into separate lines to see if the error
would highlight a specific part of that line, and found the error flags the
id(0) line (<--):
***
explicit Fl_Pixmap(char * const * D) :
Fl_Image(-1,0,1),
alloc_data(0),
id(0), <--
mask(0)
{
set_data((const char*const*)D);
measure();
}
***
So I decided 'id' must be pre-defined in this context, so I tried changing
all instances of 'id' -> 'myid' in this file, then it no longer complained
about this file.
This made me take a look at Fl_cocoa.mm, where I found:
***
#if __GNUC__ == 3
// because Fl_Image.H, included by Fl_Sys_Menu_Bar.H, uses a private variable
name id
// that's illegal under GCC 3 -x -objective-c++
#define id id_
#endif
***
..and since this is "gcc_select 3.x" I guess that #if is becoming true,
defining lowercase 'id' as a macro for 'id_', which then messes up the 'id'
that's in Fl_Pixmap.
That's about as far as I could get.. hope that helps.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev