Skip to content

Needed to mess with the cfltk build to force X11 backend #39

Description

@dontlaugh

Perhaps this issue should be opened on cfltk, but I only got errors when running zig build.

I am on a funky desktop. Void Linux with IceWM (an x11 window manager). Lots of packages installed. I think the cmake build found a Wayland package and assumed I wanted to build Wayland backend support. cfltk built fine.

But zig build yielded an error.

error log
% zig build
install
└─ install toys
   └─ zig build-exe toys Debug native 29 errors
error: ld.lld: undefined symbol: libdecor_frame_translate_coordinate
    note: referenced by fl_libdecor-plugins.c
    note:               fl_libdecor-plugins.c.o:(fl_libdecor_titlebar_buffer) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::decoration_sizes(int*, int*, int*, int*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_close(libdecor_frame*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced 6 more times
error: ld.lld: undefined symbol: libdecor_frame_set_minimized
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::iconize()) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_configuration_get_window_state
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_configuration_get_content_size
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_is_visible
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_state_new
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
    note: referenced 1 more times
error: ld.lld: undefined symbol: libdecor_frame_commit
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::resize(int, int, int, int)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_is_floating
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::resize(int, int, int, int)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_state_free
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::resize(int, int, int, int)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_set_fullscreen
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_get_xdg_toplevel
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::fullscreen_off(int, int, int, int)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::fullscreen_on()) in archive /usr/local/lib64/libfltk.a
    note: referenced 13 more times
error: ld.lld: undefined symbol: libdecor_frame_set_visibility
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::use_border()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_get_content_width
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_get_content_height
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_set_min_content_size
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_unref
    note: referenced by Fl_Wayland_Screen_Driver.cxx
    note:               Fl_Wayland_Screen_Driver.cxx.o:(Fl_Wayland_Screen_Driver::close_display()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_set_max_content_size
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_get_xdg_surface
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(handle_configure(libdecor_frame*, libdecor_configuration*, void*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_unset_capabilities
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::makeWindow()) in archive /usr/local/lib64/libfltk.a
    note: referenced 1 more times
error: ld.lld: undefined symbol: libdecor_frame_set_capabilities
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::size_range()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_unref
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::hide()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_set_parent
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::makeWindow()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_decorate
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::makeWindow()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_set_app_id
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::makeWindow()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_set_title
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::makeWindow()) in archive /usr/local/lib64/libfltk.a
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::label(char const*, char const*)) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_map
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::makeWindow()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_new
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::makeWindow()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_set_maximized
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::maximize()) in archive /usr/local/lib64/libfltk.a
error: ld.lld: undefined symbol: libdecor_frame_unset_maximized
    note: referenced by Fl_Wayland_Window_Driver.cxx
    note:               Fl_Wayland_Window_Driver.cxx.o:(Fl_Wayland_Window_Driver::un_maximize()) in archive /usr/local/lib64/libfltk.a
error: the following command failed with 29 compilation errors:
/home/coleman/zig/zig build-exe -ODebug --dep toys_lib --dep zfltk -Mroot=/home/coleman/srcs/toys/src/main.zig -ODebug -Mtoys_lib=/home/coleman/srcs/toys/src/root.zig -search_paths_first_static -lcfltk -lfltk -lfltk_images -lfltk_png -lfltk_jpeg -lfltk_z -lfltk_gl -search_paths_first -lwayland-client -lwayland-cursor -lxkbcommon -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -ldbus-1 -lEGL -lwayland-egl -lwayland-client -lGL -lGLU -lOpenGL -lX11 -lXext -lXinerama -lXcursor -lXrender -lX11 -lXfixes -I/usr/include/freetype2 -I/usr/include/libpng16 -lXft -I/usr/include/freetype2 -I/usr/include/libpng16 -lfontconfig -lfreetype -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -lpangoxft-1.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype -lXft -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -lgobject-2.0 -lglib-2.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pixman-1 -lcairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pixman-1 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lcairo -ODebug -Mzfltk=/home/coleman/.cache/zig/p/zfltk-0.0.4-f3VRY1sUAgDx-bVEnwtJE_zzEQN-5vgfO_yJlQonbGcu/src/zfltk.zig -lc++ -lc --cache-dir /home/coleman/srcs/toys/.zig-cache --global-cache-dir /home/coleman/.cache/zig --name toys --zig-lib-dir /home/coleman/zig/lib/ --listen=- 
Build Summary: 2/5 steps succeeded; 1 failed
install transitive failure
└─ install toys transitive failure
   └─ zig build-exe toys Debug native 29 errors
error: the following build command failed with exit code 1:
/home/coleman/srcs/toys/.zig-cache/o/757671621eaa2a320e19b5ba9e2b034d/build /home/coleman/zig/zig /home/coleman/zig/lib /home/coleman/srcs/toys /home/coleman/srcs/toys/.zig-cache /home/coleman/.cache/zig --seed 0xfa52623f -Zfbdff5716a0389d4

TL;DR is: many missing symbols like the following.

error: ld.lld: undefined symbol: libdecor_frame_translate_coordinate

After reading fltk's wayland-related README, it seems like libdecor is only needed on wayland.

My solution was to build and install cfltk with these adjustments. I'm not sure if cmake_options.txt updates were needed.

% git diff
diff --git a/cmake_options.txt b/cmake_options.txt
diff --git a/cmake_options.txt b/cmake_options.txt
index 24273dc..f7d6ee2 100644
--- a/cmake_options.txt
+++ b/cmake_options.txt
@@ -10,4 +10,6 @@
 -DFLTK_OPTION_LARGE_FILE=ON \
 -DFLTK_BUILD_HTML_DOCS=OFF \
 -DFLTK_BUILD_PDF_DOCS=OFF \
--DFLTK_USE_PANGO=ON
\ No newline at end of file
+-DFLTK_USE_PANGO=ON \
+-DFLTK_BACKEND_X11=ON \
+-DFLTK_BACKEND_WAYLAND=OFF
diff --git a/scripts/bootstrap_posix.sh b/scripts/bootstrap_posix.sh
index 25a0dc3..969a637 100755
--- a/scripts/bootstrap_posix.sh
+++ b/scripts/bootstrap_posix.sh
@@ -16,12 +16,13 @@ COMMON_ARGS="
 -DFLTK_BUILD_PDF_DOCS=OFF
 -DFLTK_BUILD_FLUID=OFF
 -DFLTK_BUILD_FLTK_OPTIONS=OFF
+-DFLTK_BACKEND_X11=ON
+-DFLTK_BACKEND_WAYLAND=OFF
 "
 
 # Linux/BSD gets these extras
 LINUX_ARGS="
 -DFLTK_USE_PANGO=ON
--DFLTK_GRAPHICS_CAIRO=ON
 -DFLTK_USE_LIBDECOR_GTK=OFF
 "

One more thing: my original install was just a naive sudo ./scripts/bootstrap_posix.sh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions