fltk-1.3.4-1 doesn't compile with configure --enable-cairo --enable-cairoext

104 views
Skip to first unread message

Manfred Herr

unread,
Nov 23, 2016, 2:47:52 PM11/23/16
to fltk.general
I'm on Ubuntu 16.04 and switched to fltk-1.3.4-1. After download and configure --enable-cairo --enable-cairoext make stopped in fl_shapes.cxx complaining that cairo_make_current is not a member of Fl. Dropping --enable-cairoext makes make succeed. I'm writing this from memory, so some typos may be there.

Albrecht Schlosser

unread,
Nov 23, 2016, 5:15:15 PM11/23/16
to fltkg...@googlegroups.com
Please try attached patch.

This patch adds

#include <config.h>

before all other FLTK headers and works for me.

Please tell us if it works for you if you used the same with 1.3.3 and
if it worked for you.

Did you use this with FLTK 1.3.3, and did it work?

Note: I found the same compilation error in 1.3.3, but 1.3.2 compiled
w/o error. Can you confirm this?

cairoext.patch

Manfred Herr

unread,
Nov 24, 2016, 9:33:16 AM11/24/16
to fltk.general, Albrech...@online.de


Am Mittwoch, 23. November 2016 23:15:15 UTC+1 schrieb Albrecht Schlosser:
On 23.11.2016 20:47 Manfred Herr wrote:
> I'm on Ubuntu 16.04 and switched to fltk-1.3.4-1. After download and
> configure --enable-cairo --enable-cairoext make stopped in fl_shapes.cxx
> complaining that cairo_make_current is not a member of Fl. Dropping
> --enable-cairoext makes make succeed. I'm writing this from memory, so
> some typos may be there.

Please try attached patch.

This patch adds

   #include <config.h>

before all other FLTK headers and works for me.
It works for me as well.

Please tell us if it works for you if you used the same with 1.3.3 and
if it worked for you.

Did you use this with FLTK 1.3.3, and did it work?
Can't tell. Supposedly I used enable-cairo alone. I do not work with "autolink".
cairoext was enabled because I searched the configure help for cairo and used both findings. 

Note: I found the same compilation error in 1.3.3, but 1.3.2 compiled
w/o error. Can you confirm this?
 No, I am sorry.

Albrecht Schlosser

unread,
Nov 24, 2016, 4:12:20 PM11/24/16
to fltkg...@googlegroups.com
On 24.11.2016 15:33 Manfred Herr wrote:
>
> Am Mittwoch, 23. November 2016 23:15:15 UTC+1 schrieb Albrecht Schlosser:
>
> On 23.11.2016 20:47 Manfred Herr wrote:
> > I'm on Ubuntu 16.04 and switched to fltk-1.3.4-1. After download and
> > configure --enable-cairo --enable-cairoext make stopped in
> fl_shapes.cxx
> > complaining that cairo_make_current is not a member of Fl. Dropping
> > --enable-cairoext makes make succeed. I'm writing this from
> memory, so
> > some typos may be there.
>
> Please try attached patch.
>
> This patch adds
>
> #include <config.h>
>
> before all other FLTK headers and works for me.
>
> It works for me as well.

Thanks for confirmation.

> Please tell us if it works for you if you used the same with 1.3.3 and
> if it worked for you.
>
> Did you use this with FLTK 1.3.3, and did it work?
>
> Can't tell. Supposedly I used enable-cairo alone. I do not work with
> "autolink".
> cairoext was enabled because I searched the configure help for cairo and
> used both findings.

Okay, thanks anyway.

Manfred Herr

unread,
Nov 26, 2016, 10:39:20 AM11/26/16
to fltk.general, Albrech...@online.de
I just want to inform you that after using the patch of Albrecht and producing the libraries with both enables my current program (not using cairo at all) doesn't link: Undefined references in Flx.cxx for cairo_make_current and a second one. So i just dropped --enable-cairoext. Then I did a rebuild and all is fine.


Albrecht Schlosser

unread,
Nov 26, 2016, 7:05:21 PM11/26/16
to fltkg...@googlegroups.com
Thanks for the information.

I think this is "normal" for FLTK 1.3.x. If you build with the 2nd
option ( --enable-cairoext ) then FLTK add some calls to set up the
cairo context in all window drawing method, likely at least a call to
cairo_make_current.

This function is in FLTK's cairo lib, so you would have to link all your
programs with libfltk_cairo, and that implies that you'd also have to
link with your system's cairo libs (Linux: -lcairo -lpixman-1).

I thought there was a warning in the docs, but I couldn't find it right now.

Anyway, thanks for the heads-up. I added a comment (#4) on this topic to
STR #3284: "Cairo integration needs redesign".

http://www.fltk.org/str.php?L3284

Reply all
Reply to author
Forward
0 new messages