about Fl_X::set_xid

26 views
Skip to first unread message

JinCai Luo

unread,
Dec 2, 2022, 7:14:45 AM12/2/22
to fltk.general
hello!
     I create a class  Inherit from Fl_Gl_Window! but compile error, incomplete type ‘Fl_X’ used in nested name specifier
    why?

transparentopenglwindow.zip

JinCai Luo

unread,
Dec 2, 2022, 7:50:15 AM12/2/22
to fltk.general
Hello
     I create a class Inherit from Fl_Gl_Window in ubuntu. but compile  error: incomplete type ‘Fl_X’ used in nested name specifier
why?
transparentopenglwindow.zip

imm

unread,
Dec 2, 2022, 9:16:48 AM12/2/22
to fltkg...@googlegroups.com
You should probably look at a few of the GL samples in the "test" and
"examples" folder and see how they derive from Fl_Gl_Window.
In essence, I think you do not have all the necessary headers included
to make this work.
Also, I'm slightly unnerved by some of the things you are doing in the
code you presented - I'm far from certain that is going to work... In
particular what you are attempting in the show() method seems ill
advised, that will interact badly with how fltk works, I suspect.

lifeatt...@gmail.com

unread,
Dec 2, 2022, 6:15:14 PM12/2/22
to fltk.general
>      I create a class Inherit from Fl_Gl_Window in ubuntu. but compile  error: incomplete type ‘Fl_X’ used in nested name specifier

You probably need the following #defines before
#include <FL/x.H>

#define FL_LIBRARY
#define FL_INTERNALS
#define USE_X11

For transparent windows, you might look at this thread.


Albrecht Schlosser

unread,
Dec 2, 2022, 7:18:53 PM12/2/22
to fltkg...@googlegroups.com
On 12/3/22 00:15 lifeatt...@gmail.com wrote:
>      I create a class Inherit from Fl_Gl_Window in ubuntu. but compile  error: incomplete type ‘Fl_X’ used in nested name specifier

You probably need the following #defines before

My comments here are only about the correct includes, I don't say that it would fix the OP's issue or not.

#include <FL/x.H>

This include is correct if you need to use Fl_X and other platform specific stuff. In FLTK 1.4 this was renamed to `FL/platform.H` but `FL/x.H` is still possible for backwards compatibility.

#define FL_LIBRARY

You should NEVER define FL_LIBRARY in user code. This must only be defined when the FLTK lib itself is compiled.

#define FL_INTERNALS

This would IMHO be OK but I'm not sure if it is ever needed.

#define USE_X11

This is no longer needed in FLTK 1.4.0 - it is now automatically defined with its new name FLTK_USE_X11:

#define FLTK_USE_X11

... if you build the library for X11.

JinCai Luo

unread,
Dec 2, 2022, 7:20:25 PM12/2/22
to fltk.general
Thank youfor your help!
Reply all
Reply to author
Forward
0 new messages