FLTK logo

Re: [fltk.general] Re: can I change the default attributes so I can set"global attributes"

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: can I change the default attributes so I can set"global attributes" "lifeatt... Oct 01, 2022  
 

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/798cd802-dd99-4d3e-a9b6-a63e8854f35fn%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.