Problems compiling FLTK 1.3.5 on Ubuntu 18.04

170 views
Skip to first unread message

Benoit T.

unread,
Jan 11, 2021, 7:35:03 AM1/11/21
to fltk.general

Hi,

I'm currently trying to install FLTK on my Ubuntu distribution, but when I launch the makefile at the root of the given archive, I get two errors, telling me that GLX_CONTEXT_MAJOR_VERSION_ARB and GLX_CONTEXT_MINOR_VERSION_ARB are not declared.

OpenGL is installed on my machine, includes and libs are placed in my /usr directory, and the OpenGL examples work fine...

Would anyone have an idea about this ?

Thank you very much

imm

unread,
Jan 11, 2021, 7:42:43 AM1/11/21
to general fltk
I think we need some additional details.

What fltk version are you using?
What command did you use to invoke the build? (And are you using cmake, for example?)

When you say the GL examples work fine, do you mean by that the fltk GL samples?

If so, the messages you are seeing may be warnings rather than errors... Which is an important distinction.
-- 
Ian
From my Fairphone FP3

Benoit T.

unread,
Jan 11, 2021, 8:09:06 AM1/11/21
to fltk.general
No problem, here are the informations :

I am using FLTK v1.3.5 (the latest on the FLTK website), as specified in topic's title.

I tried to use directly the "make" command, as said in the instructions, and to run cmake after the first fail, but without any success either.

When I'm talking about "OpenGL examples", I'm talking about the official openGL examples, available here : https://github.com/opengl-tutorials/ogl

The messages I see are definitely errors :

/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx: In function ‘__GLXcontextRec* fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice*)’:
/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx:335:7: error: ‘GLX_CONTEXT_MAJOR_VERSION_ARB’ was not declared in this scope
       GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx:335:7: note: suggested alternative: ‘FL_MAJOR_VERSION’
       GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       FL_MAJOR_VERSION
/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx:336:7: error: ‘GLX_CONTEXT_MINOR_VERSION_ARB’ was not declared in this scope
       GLX_CONTEXT_MINOR_VERSION_ARB, 2,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx:336:7: note: suggested alternative: ‘GLX_GLXEXT_VERSION’
       GLX_CONTEXT_MINOR_VERSION_ARB, 2,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       GLX_GLXEXT_VERSION

Benoit

imm

unread,
Jan 11, 2021, 8:44:38 AM1/11/21
to general fltk
On Mon, 11 Jan 2021, 13:09 Benoit T. wrote:
No problem, here are the informations :

I am using FLTK v1.3.5 (the latest on the FLTK website), as specified in topic's title.


OK - I wanted to check because folk using the head of git often say (for example) 1.3.5, but git is slightly ahead of the 1.3.5 release now. Though not in a fashion that affects GL, AFAIK.



I tried to use directly the "make" command, as said in the instructions, and to run cmake after the first fail, but without any success either.


Hmm. Curious. Make should work fine for the 1.3.5 tarball on Ubuntu (well, it always has for me!) so that's very curious...
Cmake is not all that well supported in the 1.3.5 tarball, but even then it should work.



When I'm talking about "OpenGL examples", I'm talking about the official openGL examples, available here : https://github.com/opengl-tutorials/ogl

OK


The messages I see are definitely errors :

/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx: In function ‘__GLXcontextRec* fl_create_gl_context(Fl_Window*, const Fl_Gl_Choice*)’:
/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx:335:7: error: ‘GLX_CONTEXT_MAJOR_VERSION_ARB’ was not declared in this scope
       GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx:335:7: note: suggested alternative: ‘FL_MAJOR_VERSION’
       GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       FL_MAJOR_VERSION
/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx:336:7: error: ‘GLX_CONTEXT_MINOR_VERSION_ARB’ was not declared in this scope
       GLX_CONTEXT_MINOR_VERSION_ARB, 2,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/benoit/Téléchargements/fltk-1.3.5/src/Fl_Gl_Choice.cxx:336:7: note: suggested alternative: ‘GLX_GLXEXT_VERSION’
       GLX_CONTEXT_MINOR_VERSION_ARB, 2,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       GLX_GLXEXT_VERSION

Benoit

Odd.
I may need to try that - though the only Ubuntu machine I have to hand was recently raised from the 18.04 LTS to 20.04, so not directly representative...

When it was on 18.04 I wasn't seeing issues though.

And you definitely have the GL dev packages, not just the runtimes?

Which compiler are you using?

Benoit T.

unread,
Jan 11, 2021, 10:19:53 AM1/11/21
to fltk.general
Once again, no problem for the checks.

I have been able to compile OpenGl's examples directly on my machine, so I think the dev packages are installed. I have glew, glfw3, glm, all in dev mode, with their includes and libraries. Maybe I missed something there...

I'm using G++ 7.5.0.

imm

unread,
Jan 11, 2021, 1:02:57 PM1/11/21
to general fltk
On Mon, 11 Jan 2021 at 15:19, Benoit T. wrote:
>
>
> I have been able to compile OpenGl's examples directly on my machine, so I think the dev packages are installed. I have glew, glfw3, glm, all in dev mode, with their includes and libraries. Maybe I missed something there...
>

I can never remember what packages are needed... Here's what my Ubuntu
20.04 box has installed, for comparison...

~/source$ apt list --installed | grep "dev" | grep gl

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libegl-dev/focal-updates,now 1.3.2-1~ubuntu0.20.04.1 amd64 [installed,automatic]
libgl-dev/focal-updates,now 1.3.2-1~ubuntu0.20.04.1 amd64 [installed,automatic]
libgl1-mesa-dev/focal-updates,now 20.2.6-0ubuntu0.20.04.1 amd64 [installed]
libgles-dev/focal-updates,now 1.3.2-1~ubuntu0.20.04.1 amd64
[installed,automatic]
libglewmx-dev/focal,now 1.13.0-4ubuntu3 amd64 [installed]
libglib2.0-dev-bin/focal-updates,now 2.64.3-1~ubuntu20.04.1 amd64
[installed,automatic]
libglib2.0-dev/focal-updates,now 2.64.3-1~ubuntu20.04.1 amd64
[installed,automatic]
libglu1-mesa-dev/focal,now 9.0.1-1build1 amd64 [installed]
libglvnd-dev/focal-updates,now 1.3.2-1~ubuntu0.20.04.1 amd64
[installed,automatic]
libglx-dev/focal-updates,now 1.3.2-1~ubuntu0.20.04.1 amd64 [installed,automatic]
libopengl-dev/focal-updates,now 1.3.2-1~ubuntu0.20.04.1 amd64
[installed,automatic]
libxcb-glx0-dev/focal,now 1.14-2 amd64 [installed,auto-removable]


Clearly, that's a lot of packages, many of which you probably will not
need. I'd guess that the libglx package might be the key here?

I've been poking away on this machine for many years, so it has
accumulated a lot of "extras" along they way, I doubt that many of
these packages are really needed now!

Albrecht Schlosser

unread,
Jan 11, 2021, 2:58:18 PM1/11/21
to fltkg...@googlegroups.com
I think all I installed manually for OpenGL support is this:

freeglut3-dev
libglew-dev
libglu1-mesa-dev

... on my newly installed Debian Buster (stable) system. These packages
together with the other well-known packages obviously worked for me to
build FLTK with all its GL test programs.

I'm not sure entirely but according to a list I created this is the full
list of '*-dev' packages I installed manually:

freeglut3-dev
libglew-dev
libglu1-mesa-dev
libjpeg-dev
libpango1.0-dev
libx11-dev
libxft-dev

All other required packages were pulled in as dependencies, and maybe
you could also remove one or more of these (libpango1.0-dev depends on
libxft-dev and libx11-dev, hence you could ignore these).

Note that libpango1.0-dev also depends on Cairo and libjeg-dev is kinda
optional.

Benoit T.

unread,
Jan 13, 2021, 3:14:47 AM1/13/21
to fltk.general
Looks like installing libjpeg and libpango solved the problem. Thank you !
Reply all
Reply to author
Forward
0 new messages