latest 1.4.x current: weird new build error on linux

27 views
Skip to first unread message

Greg Ercolano

unread,
Mar 12, 2024, 4:04:58 PMMar 12
to fltkc...@googlegroups.com

Getting this with a git pull and new default build/cmake:

..
[ 38%] Building C object src/CMakeFiles/fltk.dir/gtk-shell-protocol.c.o
[ 38%] Building C object src/CMakeFiles/fltk.dir/text-input-protocol.c.o
In file included from /usr/local/src/fltk-1.4.x.git/libdecor/build/fl_libdecor-plugins.c:62:
/usr/local/src/fltk-1.4.x.git/libdecor/build/../src/plugins/gtk/libdecor-gtk.c: In function 'handle_titlebar_gesture':
/usr/local/src/fltk-1.4.x.git/libdecor/build/../src/plugins/gtk/libdecor-gtk.c:2250:3: error: a label can only be part of a statement and a declaration is not a statement
 2250 |   const int title_height = gtk_widget_get_allocated_height(frame_gtk->header);
      |   ^~~~~
/usr/local/src/fltk-1.4.x.git/libdecor/build/../src/plugins/gtk/libdecor-gtk.c: In function 'pointer_button':
/usr/local/src/fltk-1.4.x.git/libdecor/build/../src/plugins/gtk/libdecor-gtk.c:2411:2: error: label at end of compound statement
 2411 |  default:
      |  ^~~~~~~
make[2]: *** [src/CMakeFiles/fltk.dir/build.make:2565: src/CMakeFiles/fltk.dir/__/libdecor/build/fl_libdecor-plugins.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:578: src/CMakeFiles/fltk.dir/all] Error 2
make: *** [Makefile:130: all] Error 2


Greg Ercolano

unread,
Mar 12, 2024, 4:15:44 PMMar 12
to fltkc...@googlegroups.com


    Strange that all the commit's builds on github don't show these errors.
    Must be something about my system?

    FWIW I'm on Ubuntu 20.04, g++ version: 9.4.0, and the output of cmake below,
    seems like there's a cmake warning which is probably relevant.

    I can supply more info if needed.



Tue 03/12/24 13:03:55 /usr/local/src/fltk-1.4.x.git/build2
[erco@harris] 363 : cmake ..
-- Warning: system libdecor doesn't satisfy version >= 0.2.0,
--          using bundled libdecor library instead.

-- Configuration Summary for FLTK 1.4.0 generated by CMake 3.16.3 --

-- The following OPTIONAL packages have been found:

 * Doxygen
 * LATEX
 * ZLIB
 * PNG
 * JPEG

-- Static libraries   will be built in /usr/local/src/fltk-1.4.x.git/build2/lib
-- Shared libraries   will not be built (set FLTK_BUILD_SHARED_LIBS=ON to build)
-- The forms library  will be built in /usr/local/src/fltk-1.4.x.git/build2/lib
-- The OpenGL library will be built in /usr/local/src/fltk-1.4.x.git/build2/lib
-- fluid              will be built in /usr/local/src/fltk-1.4.x.git/build2/bin/fluid
-- fltk-options       will be built in /usr/local/src/fltk-1.4.x.git/build2/bin/fltk-options
-- Test programs      will be built in /usr/local/src/fltk-1.4.x.git/build2/bin/test
-- Example programs   will not be built (set FLTK_BUILD_EXAMPLES=ON to build)
--
-- Build configuration     : <unspecified>
--
-- Image Libraries         : JPEG = System
--                         : PNG  = System
--                         : ZLIB = System
-- Use Wayland             : Yes (if available at run-time)
-- Use system libdecor     : No
-- All drawing uses Cairo  : Yes
-- Use Pango               : Yes
-- Fl_Cairo_Window support : No
-- Use std::               : No


-- End of Configuration Summary --

-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/fltk-1.4.x.git/build2

Tue 03/12/24 13:04:00 /usr/local/src/fltk-1.4.x.git/build2
[erco@harris] 364 : make -j 4


Albrecht Schlosser

unread,
Mar 12, 2024, 4:33:45 PMMar 12
to fltkc...@googlegroups.com
On 3/12/24 21:15 schrieb Greg Ercolano wrote:
On 3/12/24 13:04, Greg Ercolano wrote:
Getting this with a git pull and new default build/cmake:
..
[ 38%] Building C object src/CMakeFiles/fltk.dir/gtk-shell-protocol.c.o
[ 38%] Building C object src/CMakeFiles/fltk.dir/text-input-protocol.c.o
In file included from /usr/local/src/fltk-1.4.x.git/libdecor/build/fl_libdecor-plugins.c:62:
/usr/local/src/fltk-1.4.x.git/libdecor/build/../src/plugins/gtk/libdecor-gtk.c: In function 'handle_titlebar_gesture':
/usr/local/src/fltk-1.4.x.git/libdecor/build/../src/plugins/gtk/libdecor-gtk.c:2250:3: error: a label can only be part of a statement and a declaration is not a statement
 2250 |   const int title_height = gtk_widget_get_allocated_height(frame_gtk->header);
      |   ^~~~~
/usr/local/src/fltk-1.4.x.git/libdecor/build/../src/plugins/gtk/libdecor-gtk.c: In function 'pointer_button':
/usr/local/src/fltk-1.4.x.git/libdecor/build/../src/plugins/gtk/libdecor-gtk.c:2411:2: error: label at end of compound statement
 2411 |  default:
      |  ^~~~~~~
make[2]: *** [src/CMakeFiles/fltk.dir/build.make:2565: src/CMakeFiles/fltk.dir/__/libdecor/build/fl_libdecor-plugins.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:578: src/CMakeFiles/fltk.dir/all] Error 2
make: *** [Makefile:130: all] Error 2


    Strange that all the commit's builds on github don't show these errors.
    Must be something about my system?


These errors have been reported in Issue #932 regarding Ubuntu 20.04, the same system you are reporting the error from.

    FWIW I'm on Ubuntu 20.04, g++ version: 9.4.0, and the output of cmake below,
    seems like there's a cmake warning which is probably relevant.

    I can supply more info if needed.


The CMake warning is normal, it means only that you don't have a system libdecor with version 0.2.0 or higher and this is the reason why FLTK uses the bundled libdecor and the errors appear since the latest update.

This has obviously something to do with the XML files that are provided by the system for Wayland support. These files are "compiled" to header files that are used when building libdecor.

This is something Manolo will certainly care about.

For now you could disable building Wayland (use -D FLTK_BACKEND_WAYLAND:BOOL=OFF) as a workaround to be able to build FLTK.

Note: I see compiler warnings but I don't see the error you and Chris reported on my newer Debian system.


Greg Ercolano

unread,
Mar 12, 2024, 5:00:13 PMMar 12
to fltkc...@googlegroups.com

On 3/12/24 13:33, 'Albrecht Schlosser' via fltk.coredev wrote:

For now you could disable building Wayland (use -D FLTK_BACKEND_WAYLAND:BOOL=OFF) as a workaround to be able to build FLTK.

    Thanks -- yes, that works and I can build without errors again.

Manolo

unread,
Mar 12, 2024, 6:03:46 PMMar 12
to fltk.coredev
The compilation errors have been removed.

Reply all
Reply to author
Forward
0 new messages