|
|
Thanks everybody...
the difference in the code is I had:-
#include <FL/Fl.H> FL_NORMAL_SIZE = 11;
int main(int argc, ...) {
and it seems to need:-
#include <FL/Fl.H> int main(int argc, ...) { FL_NORMAL_SIZE = 11; I had the impression that if you wanted something global in C++ you had to code it before the functions. That's not the 1st time I'll be wrong about C++ (lol)
Thanks again everybody
On Sunday, October 2, 2022 at 10:03:03 AM UTC+11 lifeatt...@gmail.com wrote:
FL_NORMAL_SIZE = 11;
‘FL_NORMAL_SIZE’ does not name a type
This is the sort of error to expect when the C++ compiler doesn't know what the definition is. The appropriate include file has to be used before you reference the variable.
In this case, FL_NORMAL_SIZE is defined in Enumerations.H. That header is normally already included as part of other FLTK headers. I can only guess you're trying to access that variable without a bunch of header files.
When in doubt, use Fl.H:
#include <FL/Fl.H> int main(int argc, ...) { FL_NORMAL_SIZE = 11; }
Fl_Fontsize FL_NORMAL_SIZE = 11;
/usr/lib/x86_64-linux-gnu/libfltk.a(Fl_Widget.o):(.data+0x0): multiple definition of `FL_NORMAL_SIZE'; /tmp/ccdB
GgUp.o:(.data+0x0): first defined here
Here you've defined a conflicting copy of FL_NORMAL_SIZE. This might have worked if you had used this instead:
extern Fl_Fontsize FL_NORMAL_SIZE = 11;
The "extern" part tells the compiler/linker to look for the definition elsewhere, i.e. in the FLTK library, not in your code.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/dc6b817d-5ed5-4e19-bb77-e3b9be1e206bn%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |