On 30.04.2012 00:38, fltkCoder wrote:

> What do you mean "not have posted the compiler error". I have posted it 
> several
> times. Its in the first post as a matter a fact.
>
> This is what it returns for the code lines I posted as well.
>
> "line1 error: expected unqualified-id before numeric constant
> line1 error: expected initializer before numeric constand
> line2 error: invalid conversion from 'int' to 'Fl_Group*'
> line3 error: base operand of '->' is not a pointer"
>
> This is the output for these lines, I've marked them:
> line1: Fl_Group *grp2 = new Fl_Group(25, 25, 620, 605);
> new Fl_Text_Display(145, 325, 400, 75);
> line2: panes[2] = grp2;
> line3: grp2->end();

We like to see real compiler output, or better have a *small* code
example so that we can try it ourselves.

> As for your "minimal, complete single-file implementation", I have posted the
> entire file. I really don't see what seems to be the problem here.

... but you know that there is a difference between *minimal* and
"entire file", don't you ? ;-)

> I have stated the problem VERY clearly, many times. If you would have just 
> read
> what I wrote.

Believe me, we all want to help you, but sometimes we need some
cooperation from you. When you're asked questions about details
or when you're given some advice, please (try to) do what you're
asked to help us to help you.

That said, see what I consider a minimal example that shows the
error in your case (2 lines):

#include <FL/Fl_Text_Display.H>
Fl_Group *grp1;

Compiler errors, using current MinGW (g++ 4.6.2):

$ g++ -c tx1.cxx `fltk-config --cxxflags`
tx1.cxx:2:11: error: expected unqualified-id before numeric constant
tx1.cxx:2:11: error: expected initializer before numeric constant

Yes, I can reproduce it with my configuration, and it turns out that
the following is an even shorter example code ( but also 2 lines):

#include <windows.h>
int *grp1;

$ g++ -c tx1.cxx
tx1.cxx:2:6: error: expected unqualified-id before numeric constant
tx1.cxx:2:6: error: expected initializer before numeric constant

So it turns out that it is not a FLTK problem. MinGW's windows.h
file includes (among others) <dlgs.h>, and in this file, there is:

#define grp1 0x430
#define grp2 0x431
#define grp3 0x432
#define grp4 0x433

Hence the solution is easy: don't use "grp1" - "grp4" as variable
names, or complain at Microsoft or the MinGW maintainers, whoever
is responsible for this mess...

... or do, as suggested by Greg, and add

#ifdef grp1 // or maybe WIN32
#undef grp1
#undef grp2
#undef grp3
#undef grp4
#endif

after all the include files.

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to