bug in Fl_Cairo.h?

34 views
Skip to first unread message

Andre Steenveld

unread,
Jan 9, 2026, 2:39:33 PM (13 days ago) Jan 9
to fltk.general
Hi all

In short, I found a possible bug or I messed up my project configuration.

Here is the diff for what I thing is a bug.
Fl_Cairo.h`
-# include <cairo.h>
+# include <cairo/cairo.h>

Can anybody confirm that I messed up or is this a real problem?

And for the details.

For a project I need to use FLTK once on MSVC and once on Debian. I have a MSVC background and the last time of serious work with *nix is more than 25 years ago. So, I'm a bit rusty on that side.
I created a virual machine with Debian 13 (trixie) and configured a development environment. One of the things I installed was `sudo apt install libfltk1.4-dev` together with all its dependencies.

Then I created a simple test program with the following details.

CMakeLists.txt
    # bare bone cmake file for test of FLTK with one main.cpp source file.
    cmake_minimum_required(VERSION 3.31.6)
    project( TestLibFltk LANGUAGES CXX)
    set(CMAKE_CXX_EXTENSIONS OFF)
    find_package(FLTK REQUIRED)

    add_executable(TestLibFltk main.cpp)
    target_compile_features(TestLibFltk INTERFACE cxx_std_17)
    target_include_directories(TestLibFltk PUBLIC ${FLTK_INCLUDE_DIR})
    #target_include_directories(TestLibFltk PUBLIC /usr/include/cairo )
    target_link_libraries(TestLibFltk PRIVATE ${FLTK_LIBRARIES})

main.cpp
    #include <FL/Fl.H>
    #include <FL/Fl_Box.H>
    #include <FL/Fl_Window.H>
    int main() {
        Fl_Window win(400, 400, "Bye");
        win.show();
        return Fl::run();
    }

It does't get simpler than this. And it does not work!

    andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build
    -- The CXX compiler identification is GNU 14.2.0
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    -- Found X11: /usr/include
    -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
    -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
    -- Looking for gethostbyname
    -- Looking for gethostbyname - found
    -- Looking for connect
    -- Looking for connect - found
    -- Looking for remove
    -- Looking for remove - found
    -- Looking for shmat
    -- Looking for shmat - found
    -- Looking for IceConnectionNumber in ICE
    -- Looking for IceConnectionNumber in ICE - found
    -- Found FLTK: /usr/lib/x86_64-linux-gnu/libfltk_images.so;/usr/lib/x86_64-linux-gnu/libfltk_forms.so;/usr/lib/x86_64-linux-gnu/libfltk_gl.so;/usr/lib/x86_64-linux-gnu/libfltk.so
    -- Configuring done (7.1s)
    -- Generating done (0.0s)
    -- Build files have been written to: /home/andre/development/FLTK/LibTest/build
    andre@debian:~/development/FLTK/LibTest/sources$ cmake --build ../build
    [ 50%] Building CXX object CMakeFiles/TestLibFltk.dir/main.cpp.o
    In file included from /usr/include/FL/Fl.H:30,
                     from /home/andre/development/FLTK/LibTest/sources/main.cpp:2:
    /usr/include/FL/Fl_Cairo.H:40:11: fatal error: cairo.h: No such file or directory
       40 | # include <cairo.h>
          |           ^~~~~~~~~
    compilation terminated.
    gmake[2]: *** [CMakeFiles/TestLibFltk.dir/build.make:79: CMakeFiles/TestLibFltk.dir/main.cpp.o] Error 1
    gmake[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/TestLibFltk.dir/all] Error 2
    gmake: *** [Makefile:91: all] Error 2
    andre@debian:~/development/FLTK/LibTest/sources$

Some checking showed that `cairo.h` is lokated in in `usr/include/cairo`.
And Fl_Cairo.h r40 `# include <cairo.h>` does not work.

I may have made de mistake in not adding all paths for include files but the way it is organised
makes me thing that there is a mistake in Fl_Cairo.h
Changing r40 to `# include <cairo/cairo.h>` should fix it.

But is not what I did, I do not like to change installed packages.
I added an extra include line in CMakeLists.txt (the one in comments in the listing above).
Now it compiles, links and I can start the result without a problem.

Albrecht Schlosser

unread,
Jan 9, 2026, 5:02:47 PM (13 days ago) Jan 9
to fltkg...@googlegroups.com
See my reply below ...


On 1/9/26 20:12 Andre Steenveld wrote:
In short, I found a possible bug or I messed up my project configuration.

Here is the diff for what I thing is a bug.
Fl_Cairo.h`
-# include <cairo.h>
+# include <cairo/cairo.h>

Can anybody confirm that I messed up or is this a real problem?

No, that's not the correct solution.


For a project I need to use FLTK once on MSVC and once on Debian. I have a MSVC background and the last time of serious work with *nix is more than 25 years ago. So, I'm a bit rusty on that side.
I created a virual machine with Debian 13 (trixie) and configured a development environment. One of the things I installed was `sudo apt install libfltk1.4-dev` together with all its dependencies.

Then I created a simple test program with the following details.

CMakeLists.txt
    # bare bone cmake file for test of FLTK with one main.cpp source file.
    cmake_minimum_required(VERSION 3.31.6)
    project( TestLibFltk LANGUAGES CXX)
    set(CMAKE_CXX_EXTENSIONS OFF)
    find_package(FLTK REQUIRED)

    add_executable(TestLibFltk main.cpp)
    target_compile_features(TestLibFltk INTERFACE cxx_std_17)
    target_include_directories(TestLibFltk PUBLIC ${FLTK_INCLUDE_DIR})
    #target_include_directories(TestLibFltk PUBLIC /usr/include/cairo )

As you wrote below, the line above should be uncommented. But the correct solution is not as simple as that.

[more info stripped off]


    andre@debian:~/development/FLTK/LibTest/sources$ cmake --build ../build
    [ 50%] Building CXX object CMakeFiles/TestLibFltk.dir/main.cpp.o
    In file included from /usr/include/FL/Fl.H:30,
                     from /home/andre/development/FLTK/LibTest/sources/main.cpp:2:
    /usr/include/FL/Fl_Cairo.H:40:11: fatal error: cairo.h: No such file or directory
       40 | # include <cairo.h>
          |           ^~~~~~~~~
    compilation terminated.
    gmake[2]: *** [CMakeFiles/TestLibFltk.dir/build.make:79: CMakeFiles/TestLibFltk.dir/main.cpp.o] Error 1
    gmake[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/TestLibFltk.dir/all] Error 2
    gmake: *** [Makefile:91: all] Error 2
    andre@debian:~/development/FLTK/LibTest/sources$

Some checking showed that `cairo.h` is lokated in in `usr/include/cairo`.

Yep.


And Fl_Cairo.h r40 `# include <cairo.h>` does not work.

I may have made de mistake in not adding all paths for include files but the way it is organised
makes me thing that there is a mistake in Fl_Cairo.h
Changing r40 to `# include <cairo/cairo.h>` should fix it.

In fact you *should* add the relevant include path(s).


But is not what I did, I do not like to change installed packages.
I added an extra include line in CMakeLists.txt (the one in comments in the listing above).
Now it compiles, links and I can start the result without a problem.

Instead of just adding the hard coded include path you should let CMake find it out. I don't have the details handy but here's evidence: on a typical Linux system like Debian you can use pkg-config to find out what the include paths are (in CMake the typical usage would be find_package or pkg_search_module [1] ). On my Debian (Bookworm) I have:

$ pkg-config --cflags cairo
-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16

As you can see it's not only the path '/usr/include/cairo' but several other paths as well that are needed.

[1] In our own (FLTK) CMake project we're using pkg-config indirectly like this:

  pkg_search_module(PKG_CAIRO cairo)

The details are beyond the scope of this reply, but you should get a feeling what to do. The correct way is to add the cairo include paths.

Andre Steenveld

unread,
Jan 9, 2026, 6:14:48 PM (13 days ago) Jan 9
to fltk.general
>  No, that's not the correct solution.
Well that is a clear anwer.

>  In fact you *should* add the relevant include path(s).
...
> Instead of just adding the hard coded include path you should let CMake find it out.
> I don't have the details handy but here's evidence: on a typical Linux system like Debian
> you can use pkg-config to find out what the include paths are (in CMake the typical usage
> would be find_package or pkg_search_module [1] ). On my Debian (Bookworm) I have:
>
>$ pkg-config --cflags cairo
> -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
> -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16
>

>As you can see it's not only the path '/usr/include/cairo' but several other paths as well that are needed.
I agree that there is more than just one path and that CMake should check for the dependencies.
The hard coded path was just a quick workaround. With some test code like this it shows something but it is not how it should be done.

But I see a problem here. For me FLTK-1.4.3 is the only known dependency for this code.
What other (implicit) dependencies are there? Where do I get information on what to check?
Did I miss something in the documentation?

>  [1] In our own (FLTK) CMake project we're using pkg-config indirectly like this:...
I will follow that to find out about it.

Op vrijdag 9 januari 2026 om 23:02:47 UTC+1 schreef Albrecht-S:

Albrecht Schlosser

unread,
Jan 9, 2026, 6:42:17 PM (13 days ago) Jan 9
to fltkg...@googlegroups.com
On 1/10/26 00:03 Andre Steenveld wrote:

I agree that there is more than just one path and that CMake should check for the dependencies.
The hard coded path was just a quick workaround. With some test code like this it shows something but it is not how it should be done.

But I see a problem here. For me FLTK-1.4.3 is the only known dependency for this code.
What other (implicit) dependencies are there? Where do I get information on what to check?

Good questions.


Did I miss something in the documentation?

Did you read README.CMake.txt ?

Let me explain why I asked this question. Fortunately you're using a "modern" Linux system with FLTK 1.4.3 . Therefore you can use "modern CMake" to build your application as described in README.CMake.txt, and this makes a HUGE difference. It simplifies using libraries a lot!

To do this you would add the keyword "CONFIG" to the find_package() statement like this:

    find_package(FLTK 1.4 CONFIG REQUIRED)

Note that I also added '1.4' so you won't find an older FLTK installation (e.g FLTK 1.3) or one w/o a CMake config file.

The real benefit of such a config file and "modern CMake" is that you don't need to care about recursive dependencies of a particular library. Then you can replace your CMake code (regarding the FLTK library) with this much simpler code:

  add_executable(TestLibFltk main.cpp)
  target_compile_features(TestLibFltk INTERFACE cxx_std_17)            # optional
  # target_include_directories(TestLibFltk PUBLIC ${FLTK_INCLUDE_DIR}) # remove this line
  # target_include_directories(TestLibFltk PUBLIC /usr/include/cairo ) # remove this line
  target_link_libraries(TestLibFltk PRIVATE fltk::fltk)

Note that the target `fltk::fltk` is internally read from FLTK's config file and provides all required dependencies, particularly include directories and link libraries. There's nothing you need to add yourself, unless you use a library in your own code.

Setting C++ standard is not required in this case. FLTK will automatically enable the required standard, but with FLTK 1.4 you don't need anything newer than C++98.

I recommend to read README.CMake.txt, and if you have further questions, please feel free to ask again.

PS: in my previous post I assumed that you used Cairo yourself in your program. Sorry for not reading your post correctly.

Andre Steenveld

unread,
Jan 10, 2026, 9:58:13 AM (12 days ago) Jan 10
to fltk.general
> Did you read README.CMake.txt ?
Yep, the 1.4.4 version of it, and did reread it just now.
As well as README.Cairo.txt

Some of the prolems look related to finding the cairo package. This are the install details.
    andre@debian:~/Desktop$ sudo apt upgrade libcairo2
    libcairo2 is already the newest version (1.18.4-1+b1).
    Summary:                  
      Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
    andre@debian:~/Desktop$ pkg-config --modversion cairo
    1.18.4
    andre@debian:~/Desktop$ pkg-config --cflags cairo
    -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/pixman-1
    andre@debian:~/Desktop$

>  find_package(FLTK 1.4 CONFIG REQUIRED)
I am aware of that but can't get it to work.


    cmake_minimum_required(VERSION 3.31.6)
    project( TestLibFltk LANGUAGES CXX)
    set(CMAKE_CXX_EXTENSIONS OFF)
   
    find_package(FLTK 1.4 REQUIRED)
    add_executable(TestLibFltk main.cpp)
    target_compile_features(TestLibFltk INTERFACE cxx_std_17) # optional but I stick to it.
    target_link_libraries(TestLibFltk PRIVATE fltk::fltk})

   
andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build
    CMake Error at /usr/share/fltk/FLTK-Targets-none.cmake:192 (add_library):
      add_library cannot create imported target "fltk::fluid" because another
      target with the same name already exists.
    Call Stack (most recent call first):
      /usr/share/fltk/FLTK-Targets.cmake:166 (include)
      /usr/share/fltk/FLTKConfig.cmake:39 (include)
      CMakeLists.txt:14 (find_package)
   
    CMake Error at /usr/share/fltk/FLTK-Targets-none.cmake:222 (add_library):
      add_library cannot create imported target "fltk::options" because another
      target with the same name already exists.
    Call Stack (most recent call first):
      /usr/share/fltk/FLTK-Targets.cmake:166 (include)
      /usr/share/fltk/FLTKConfig.cmake:39 (include)
      CMakeLists.txt:14 (find_package)
   
    CMake Error at /usr/share/fltk/FLTK-Targets.cmake:181 (message):
      The imported target "fltk::fluid-shared" references the file
         "/usr/bin/fluid-shared"
      but this file does not exist.  Possible reasons include:
   
      * The file was deleted, renamed, or moved to another location.
      * An install or uninstall procedure did not complete successfully.
      * The installation package was faulty and contained
         "/usr/share/fltk/FLTK-Targets.cmake"
   
      but not all the files it references.
   
    Call Stack (most recent call first):
      /usr/share/fltk/FLTKConfig.cmake:39 (include)
      CMakeLists.txt:14 (find_package)
   
    -- Configuring incomplete, errors occurred!

I do not know what to do with this result.

Then I tried to detect Cairo in the top CMakeLists.txt file, this also fails.


    cmake_minimum_required(VERSION 3.31.6)
    project( TestLibFltk LANGUAGES CXX)
    set(CMAKE_CXX_EXTENSIONS OFF)
   
    find_package(Cairo REQUIRED)
    find_package(FLTK 1.4 REQUIRED)

   
    add_executable(TestLibFltk main.cpp)
    target_compile_features(TestLibFltk INTERFACE cxx_std_17)
    target_include_directories(TestLibFltk PUBLIC ${FLTK_INCLUDE_DIR})
    target_link_libraries(TestLibFltk PRIVATE ${FLTK_LIBRARIES})
    target_link_libraries(TestLibFltk PRIVATE cairo::cairo})


andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build
    CMake Error at CMakeLists.txt:11 (find_package):
      By not providing "FindCairo.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "Cairo", but
      CMake did not find one.
   
      Could not find a package configuration file provided by "Cairo" with any of
      the following names:
   
        CairoConfig.cmake
        cairo-config.cmake
   
      Add the installation prefix of "Cairo" to CMAKE_PREFIX_PATH or set
      "Cairo_DIR" to a directory containing one of the above files.  If "Cairo"
      provides a separate development package or SDK, be sure it has been
      installed.

    -- Configuring incomplete, errors occurred!

And several tries with command line options aimed at disabling the use or cairo, which are all ignored.
That also fails.

andre@debian:~/development/FLTK/LibTest/sources$ cmake -D FLTK_BACKEND_X11:BOOL=ON -S . -B ../build
...
CMake Warning:
  Manually-specified variables were not used by the project:

    FLTK_BACKEND_X11

andre@debian:~/development/FLTK/LibTest/sources$ cmake -D FLTK_GRAPHICS_CAIRO:BOOL=OFF -S . -B ../build
andre@debian:~/development/FLTK/LibTest/sources$ cmake -D FLTK_BACKEND_X11:BOOL=ON -S . -B ../build
andre@debian:~/development/FLTK/LibTest/sources$ cmake -D FLTK_BACKEND_X11:BOOL=ON -D FLTK_BACKEND_WAYLAND:BOOL=OFF -S . -B ../build

Not making any progress at the moment.

Op zaterdag 10 januari 2026 om 00:42:17 UTC+1 schreef Albrecht-S:

Albrecht Schlosser

unread,
Jan 10, 2026, 10:49:35 AM (12 days ago) Jan 10
to fltkg...@googlegroups.com
Sigh.  :-(

What you describe is unfortunately a known issue with the installed FLTK version on Debian Trixie (a packaging bug). ISTR that I worked on a fix (workaround) but this involved installing additional packages (to resolve missing files) and patching one of the *installed* FLTK config files. At least. IIRC this bug is visible in latest Ubuntu releases as well. Rumors say that Debian Testing (aka forky) has this bug fixed but I didn't find the time to check it yet.
One possible reference: https://www.mail-archive.com/debian-b...@lists.debian.org/msg2052371.html
 
Anyway, there are IMHO two ways to continue for you:

(1) Try building (and optionally installing) FLTK yourself. If you want to go that route I suggest to remove (uninstall) the FLTK package(s) of the Debian distro. Note that installing FLTK is optional, I also suggest:
(1a) try to use the build directory directly (you may need to set CMake variable FLTK_DIR accordingly), or
(1b) if (1a) succeeds, install to a local directory, likely below your home directory.

(2) Install additional FLTK packages as required by my patch - which I didn't find right now. However, I'll check further where I posted it and I'll post here what I found within the next 1 - 2 hours (hopefully). Please let me know if you like to try this.

Some more details below ...


On 1/10/26 15:52 Andre Steenveld wrote:
> Did you read README.CMake.txt ?
Yep, the 1.4.4 version of it, and did reread it just now.

Good.

As well as README.Cairo.txt

Some of the prolems look related to finding the cairo package. This are the install details. [...]

I don't think that the main problem has anything to do with the Cairo installation. Let's concentrate on the more obvious "find FLTK package" question.


>  find_package(FLTK 1.4 CONFIG REQUIRED)
I am aware of that but can't get it to work.

    cmake_minimum_required(VERSION 3.31.6)
    project( TestLibFltk LANGUAGES CXX)
    set(CMAKE_CXX_EXTENSIONS OFF)
   
    find_package(FLTK 1.4 REQUIRED)
    add_executable(TestLibFltk main.cpp)
    target_compile_features(TestLibFltk INTERFACE cxx_std_17) # optional but I stick to it.

That's OK.


    target_link_libraries(TestLibFltk PRIVATE fltk::fltk})

There's an extraneous '}' before the closing ')'. Is this a typo only here or in your CMakeLists.txt file?


andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build
    CMake Error at /usr/share/fltk/FLTK-Targets-none.cmake:192 (add_library):
      add_library cannot create imported target "fltk::fluid" because another
      target with the same name already exists.

That's one of the problems I mentioned above.

...    

    CMake Error at /usr/share/fltk/FLTK-Targets-none.cmake:222 (add_library):
      add_library cannot create imported target "fltk::options" because another
      target with the same name already exists.

Another symptom of the same problem.
...

    CMake Error at /usr/share/fltk/FLTK-Targets.cmake:181 (message):
      The imported target "fltk::fluid-shared" references the file
         "/usr/bin/fluid-shared"

Yet another symptom.

 ...


    -- Configuring incomplete, errors occurred!

I do not know what to do with this result.

As I wrote above, either build FLTK yourself to avoid the current Debian packaging bug, or wait a moment for my fix ...


Then I tried to detect Cairo in the top CMakeLists.txt file, this also fails.

    cmake_minimum_required(VERSION 3.31.6)
    project( TestLibFltk LANGUAGES CXX)
    set(CMAKE_CXX_EXTENSIONS OFF)
   
    find_package(Cairo REQUIRED)

Unfortunately there is no `FindCairo` package in the CMake distro, hence we need to use the pkg-config feature to find Cairo.


    find_package(FLTK 1.4 REQUIRED)
   
    add_executable(TestLibFltk main.cpp)
    target_compile_features(TestLibFltk INTERFACE cxx_std_17)
    target_include_directories(TestLibFltk PUBLIC ${FLTK_INCLUDE_DIR})
    target_link_libraries(TestLibFltk PRIVATE ${FLTK_LIBRARIES})
    target_link_libraries(TestLibFltk PRIVATE cairo::cairo})

This (above) is likely not going to work as well since Cairo doesn't supply a CMake config file.


andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build
    CMake Error at CMakeLists.txt:11 (find_package):
      By not providing "FindCairo.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "Cairo", but
      CMake did not find one.
   
      Could not find a package configuration file provided by "Cairo" with any of
      the following names:
   
        CairoConfig.cmake
        cairo-config.cmake

This is the consequence (see my notes above).
Yes, CMake can be difficult to use in some cases.

(more trial-and-error info removed for later)

Andre Steenveld

unread,
Jan 10, 2026, 11:43:15 AM (12 days ago) Jan 10
to fltk.general
> Sigh.  :-(
Look at the bright side, you are in known territory now. ;-)


> Anyway, there are IMHO two ways to continue for you
> (1) Try building (and optionally installing) FLTK yourself.
I like to go for this option first.
Note that I aready have managed to build FLTK 1.4.4 and 1.5.0 on MSVC (Windows 10 + CMake + VS2022). Almost all test application are running without problems, a few don't for obvious reasons.
On MSVC and the same test probram I have linker problems missing MS libraries. But that is for another time if I can't fix it.

Working on option 1. I will report results later.


>  target_link_libraries(TestLibFltk PRIVATE fltk::fltk})
The extra '}' is a typo. CMake would have reported it on the first parse of the file.

> Unfortunately there is no `FindCairo` package in the CMake distro...
I found out the hard way. :-(


> Yes, CMake can be difficult to use in some cases.
Agreed. But remember with plain make you may have a bigger mess.
CMake feels to me as more productive. But if there is a problem also harder to understand.



Op zaterdag 10 januari 2026 om 16:49:35 UTC+1 schreef Albrecht-S:

Albrecht Schlosser

unread,
Jan 10, 2026, 1:54:39 PM (12 days ago) Jan 10
to fltkg...@googlegroups.com
On 1/10/26 17:43 Andre Steenveld wrote:
> Sigh.  :-(
Look at the bright side, you are in known territory now. ;-)
;^)

Yes, almost, but ...

OK, I upgraded my Debian Trixie system to current versions and installed (some of) Debian's FLTK (1.4.3) packages. However, the results are different than what I remember, but maybe what I remember was from another system like Ubuntu, or maybe OpenBSD. Sorry for the confusion, I'm confused as well.

Good news: although the installed packages are broken (from an FLTK developer's view) I could find a way to install required packages and build two simple FLTK apps: one with libfltk_images (implies libfltk) and one like a simple hello-world application that uses only libfltk.

Important: the way I found to build these applications is NOT the ideal "modern CMake" way as documented in our README.CMake.txt file but a mix of old ("classic", find-module) way and the modern CMake way (using CONFIG mode). That's a pity. I'll talk to the FLTK maintainer and I'll try to help him to fix this...

That all said, here's what you need to do:

(A) Install at least these four packages (output from `apt list --installed`):
  fltk-options/stable,now 1.4.3-1 amd64 [installed]    (2)
  fltk1.4-games/stable,now 1.4.3-1 amd64 [installed]   (2)
  fluid/stable,now 1.4.3-1 amd64 [installed]           (2)
  libfltk1.4-dev/stable,now 1.4.3-1 amd64 [installed]  (1)

Notes:

  (1) technically required
  (2) should not be required, but must be installed because of broken config files.


(B) Write your CMakeLists.txt like this:
cmake_minimum_required(VERSION 3.15)
project(fltk-versions)
find_package(FLTK 1.4 CONFIG REQUIRED)
set(prog fltk-versions)
add_executable(             ${prog} WIN32 MACOSX_BUNDLE ${prog}.cxx)
target_include_directories( ${prog} PRIVATE ${FLTK_INCLUDE_DIRS})
target_link_libraries(      ${prog} PRIVATE ${FLTK_LIBRARIES})

Notes:
- text in red color is old-style but unfortunately required in Debian Trixie
- I used test/fltk-versions.cxx for my test
- the keyword "CONFIG" is required (as it should)
- the keywords "WIN32 MACOSX_BUNDLE" are standard for Windows + macOS (ignored on Linux)
- target_include_directories requires old-style '${FLTK_INCLUDE_DIRS}'  [1]
- target_link_libraries requires old-style '${FLTK_LIBRARIES}' {2]

[1} This line shouldn't be required at all if the "modern CMake" approach worked, but it doesn't, see [2]

[2] In "modern CMake" we'd use either 'fltk::images' or 'fltk::fltk' (the former implies the latter).

Unfortunately these "tricks" are required in Debian Trixie. This is not what we (the FLTK Team) wanted and how "modern CMake" is intended to work.

Note: if you built FLTK 1.4 yourself your CMakeList.txt should look like this "modern CMake" version:
cmake_minimum_required(VERSION 3.15)
project(fltk-versions)
find_package(FLTK 1.4 CONFIG REQUIRED)
set(prog fltk-versions)
add_executable(             ${prog} WIN32 MACOSX_BUNDLE ${prog}.cxx)
target_link_libraries(      ${prog} PRIVATE fltk::fltk)
... and should work as well.

Note: text in green is the new "Modern CMake" style, and target_include_directories is not required.

Please test, and ideally confirm that this works for you so we can add this to our docs.

Andre Steenveld

unread,
Jan 10, 2026, 3:16:36 PM (12 days ago) Jan 10
to fltk.general


Op zaterdag 10 januari 2026 om 19:54:39 UTC+1 schreef Albrecht-S:
Good news: although the installed packages are broken (from an FLTK developer's view) I could find a way to install required packages and build two simple FLTK apps: one with libfltk_images (implies libfltk) and one like a simple hello-world application that uses only libfltk.
... 

Before I start building v1.4.4 I try this work around for documentation purposes.
Unfortunately, it fails. For details, see below.

(A) Install at least these four packages (output from `apt list --installed`):
fltk-options/stable,now 1.4.3-1 amd64 [installed] (2) fltk1.4-games/stable,now 1.4.3-1 amd64 [installed] (2) fluid/stable,now 1.4.3-1 amd64 [installed] (2) libfltk1.4-dev/stable,now 1.4.3-1 amd64 [installed] (1)
I have this installed.
andre@debian:~/development/FLTK/LibTest/sources$ apt list --installed | grep 'fltk\|fluid'
fltk-options/stable,now 1.4.3-1 amd64 [installed]
fltk1.4-doc/stable,now 1.4.3-1 all [installed,automatic]
fltk1.4-games/stable,now 1.4.3-1 amd64 [installed]
fluid/stable,now 1.4.3-1 amd64 [installed,automatic]
libfltk-cairo1.4/stable,now 1.4.3-1 amd64 [installed,automatic]
libfltk-forms1.4/stable,now 1.4.3-1 amd64 [installed,automatic]
libfltk-gl1.4/stable,now 1.4.3-1 amd64 [installed,automatic]
libfltk-images1.4/stable,now 1.4.3-1 amd64 [installed,automatic]
libfltk1.4-dev/stable,now 1.4.3-1 amd64 [installed]
libfltk1.4/stable,now 1.4.3-1 amd64 [installed,automatic]
libfluidsynth3/stable,now 2.4.4+dfsg-1+deb13u1 amd64 [installed,automatic]

...
(B) Write your CMakeLists.txt like this:
cmake_minimum_required(VERSION 3.15) project(fltk-versions) find_package(FLTK 1.4 CONFIG REQUIRED) set(prog fltk-versions) add_executable( ${prog} WIN32 MACOSX_BUNDLE ${prog}.cxx) target_include_directories( ${prog} PRIVATE ${FLTK_INCLUDE_DIRS}) target_link_libraries( ${prog} PRIVATE ${FLTK_LIBRARIES})
copied unchanged with one excepiton. using main.cpp.
cmake_minimum_required(VERSION 3.15)
project(fltk-versions)
find_package(FLTK 1.4 CONFIG REQUIRED)
set(prog fltk-versions)
add_executable(             ${prog} WIN32 MACOSX_BUNDLE main.cpp)

target_include_directories( ${prog} PRIVATE ${FLTK_INCLUDE_DIRS})
target_link_libraries(      ${prog} PRIVATE ${FLTK_LIBRARIES})
 
Unfortunately these "tricks" are required in Debian Trixie. This is not what we (the FLTK Team) wanted and how "modern CMake" is intended to work.
But it looks like this is not all of the story. For me it fails.

andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0

-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/fltk/FLTK-Targets-none.cmake:192 (add_library):
  add_library cannot create imported target "fltk::fluid" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)



CMake Error at /usr/share/fltk/FLTK-Targets-none.cmake:222 (add_library):
  add_library cannot create imported target "fltk::options" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)



CMake Error at /usr/share/fltk/FLTK-Targets.cmake:181 (message):
  The imported target "fltk::fluid-shared" references the file

     "/usr/bin/fluid-shared"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/share/fltk/FLTK-Targets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)



-- Configuring incomplete, errors occurred!

 
Note: if you built FLTK 1.4 yourself your CMakeList.txt should look like this "modern CMake" version:
For that I have to uninstall all of v1.4.3 or set FLTK_PATH and use `find_package(FLTK 1.4.4 CONFIG REQUIRED)` 
I will try the latter first and if I can't get it to work removing v1.4.3 is still an option.

Please test, and ideally confirm that this works for you so we can add this to our docs.
With pleasure.
 

Albrecht Schlosser

unread,
Jan 10, 2026, 3:57:07 PM (12 days ago) Jan 10
to fltkg...@googlegroups.com
On 1/10/26 21:16 Andre Steenveld wrote:
Op zaterdag 10 januari 2026 om 19:54:39 UTC+1 schreef Albrecht-S:
Good news: although the installed packages are broken (from an FLTK developer's view) I could find a way to install required packages and build two simple FLTK apps: one with libfltk_images (implies libfltk) and one like a simple hello-world application that uses only libfltk.
... 

Before I start building v1.4.4 I try this work around for documentation purposes.
Unfortunately, it fails. ...

Ooh, sorry for the confusion, again. I had worked on my *patched* VM and thus my posted modifications were not enough. Thanks for testing.

To apply my patch you need to replace (as root!) the file /usr/share/fltk/FLTK-Targets-none.cmake with the one I attach to this mail. Please backup the original file before you replace it.

I hope this helps, finally.

To verify that this was the real cause I reinstalled the original libfltk1.4-dev package, found the same issues you reported, and applied my patch which resolved the issue again.

Note: this happened because I lost track of the patch(es) I had done on my Debian Trixie VM. I apologize for the extra work you need to do now.

Note also that the patch is only a minimal version to resolve the issue, not a complete solution. In a later Debian version this file should hopefully be fixed (overwritten by upgrading the package).
FLTK-Targets-none.cmake

Andre Steenveld

unread,
Jan 10, 2026, 3:58:52 PM (12 days ago) Jan 10
to fltk.general
and now for part two (have success this time.)

Op zaterdag 10 januari 2026 om 19:54:39 UTC+1 schreef Albrecht-S:
Note: if you built FLTK 1.4 yourself your CMakeList.txt should look like this "modern CMake" version:

cmake_minimum_required(VERSION 3.15) project(fltk-versions) find_package(FLTK 1.4 CONFIG REQUIRED) set(prog fltk-versions) add_executable( ${prog} WIN32 MACOSX_BUNDLE ${prog}.cxx) target_link_libraries( ${prog} PRIVATE fltk::fltk) ... and should work as well.

build of v1.4.4
andre@debian:~/development/FLTK/LibBuild-1.4/fltk-branch-1.4$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0

-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Looking for POSIX compatible scandir
-- POSIX compatible scandir - found
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3.1")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.48")
-- Looking for png.h
-- Looking for png.h - found
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "62")
-- Checking for module 'wayland-client>=1.18'
--   Package 'wayland-client', required by 'virtual:world', not found
-- Checking for module 'wayland-cursor'
--   Package 'wayland-cursor', required by 'virtual:world', not found
-- Checking for module 'wayland-protocols>=1.15'
--   Package 'wayland-protocols', required by 'virtual:world', not found
-- Checking for module 'xkbcommon'
--   Package 'xkbcommon', required by 'virtual:world', not found
-- Not all software modules 'wayland-client>=1.18 wayland-cursor wayland-protocols>=1.15 xkbcommon' are present
-- Consequently, FLTK_BACKEND_WAYLAND is turned off.

-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Looking for glXGetProcAddressARB
-- Looking for glXGetProcAddressARB - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE

-- Configuration Summary for FLTK 1.4.4 generated by CMake 3.31.6 --

-- The following OPTIONAL packages have been found:

 * ZLIB
 * PNG
 * JPEG

-- The following OPTIONAL packages have not been found:

 * Doxygen

-- Static libraries    will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- Shared libraries    will not be built (set FLTK_BUILD_SHARED_LIBS=ON to build)
-- The forms library   will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- The OpenGL library  will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- fluid               will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin
-- fltk-options        will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin
-- Test programs       will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin/test
-- Example programs    will not be built (set FLTK_BUILD_EXAMPLES=ON to build)
--
-- Build configuration      <unspecified>
-- Installation prefix      /usr/local

-- Bundled Libraries        JPEG     = System: /usr/lib/x86_64-linux-gnu/libjpeg.so
--                          PNG      = System: /usr/lib/x86_64-linux-gnu/libpng.so
--                          ZLIB     = System: /usr/lib/x86_64-linux-gnu/libz.so

-- Use Wayland              No (X11 is used)
-- All drawing uses Cairo   No
-- Use Pango                No
-- Use Xft                  Yes
-- Fl_Cairo_Window support  No
-- Use std::                No

-- End of Configuration Summary --

-- Configuring done (16.7s)
-- Generating done (1.1s)
-- Build files have been written to: /home/andre/development/FLTK/LibBuild-1.4/build

compile it...
andre@debian:~/development/FLTK/LibBuild-1.4/fltk-branch-1.4$ cmake --build ../build
...
[100%] Linking CXX executable ../bin/test/shape
[100%] Built target shape
[100%] Building CXX object test/CMakeFiles/shadow_variables.dir/shadow_variables.cxx.o
[100%] Linking CXX executable ../bin/test/shadow_variables
[100%] Built target shadow_variables

And none of the problems reported.

Tried a number of the test programs, sudoku works fine, somehow doublebuffer is very pleasing to my eyes.

Back to the test program. I deviated from the proposed CMakeLists.txt file by adding FLTK_DIR in the file,. (Should have done this as a command line argument.)
CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(fltk-versions)
set(FLTK_DIR ~/development/FLTK/LibBuild-1.4/build)

find_package(FLTK 1.4 CONFIG REQUIRED)
set(prog fltk-versions)
add_executable(             ${prog} WIN32 MACOSX_BUNDLE main.cpp)

target_link_libraries(      ${prog} PRIVATE fltk::fltk)

andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0

-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done

-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (1.4s)

-- Generating done (0.0s)
-- Build files have been written to: /home/andre/development/FLTK/LibTest/build
-- Build files have been written to: /home/andre/development/FLTK/LibTest/build
andre@debian:~/development/FLTK/LibTest/sources$ cmake --build ../build
[ 50%] Building CXX object CMakeFiles/fltk-versions.dir/main.cpp.o
[100%] Linking CXX executable fltk-versions
[100%] Built target fltk-versions
andre@debian:~/development/FLTK/LibTest/sources$

fltk-versions runs fine but does not do very much. 

It seems I have something going this time.


Please test, and ideally confirm that this works for you so we can add this to our docs.

Done with pleasure.
 

Albrecht Schlosser

unread,
Jan 10, 2026, 4:17:20 PM (12 days ago) Jan 10
to fltkg...@googlegroups.com
On 1/10/26 21:58 Andre Steenveld wrote:
and now for part two (have success this time.)

Great, thanks!

But ... there's always a (tiny) "but", isn't it? No need to worry, but see below...

Op zaterdag 10 januari 2026 om 19:54:39 UTC+1 schreef Albrecht-S:
Note: if you built FLTK 1.4 yourself your CMakeList.txt should look like this "modern CMake" version:
cmake_minimum_required(VERSION 3.15) project(fltk-versions) find_package(FLTK 1.4 CONFIG REQUIRED) set(prog fltk-versions) add_executable( ${prog} WIN32 MACOSX_BUNDLE ${prog}.cxx) target_link_libraries( ${prog} PRIVATE fltk::fltk) ... and should work as well.

build of v1.4.4
andre@debian:~/development/FLTK/LibBuild-1.4/fltk-branch-1.4$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- ...

All good so far, and here comes the "but", part 1:


-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "62")
-- Checking for module 'wayland-client>=1.18'
--   Package 'wayland-client', required by 'virtual:world', not found
-- Checking for module 'wayland-cursor'
--   Package 'wayland-cursor', required by 'virtual:world', not found
-- Checking for module 'wayland-protocols>=1.15'
--   Package 'wayland-protocols', required by 'virtual:world', not found
-- Checking for module 'xkbcommon'
--   Package 'xkbcommon', required by 'virtual:world', not found
-- Not all software modules 'wayland-client>=1.18 wayland-cursor wayland-protocols>=1.15 xkbcommon' are present
-- Consequently, FLTK_BACKEND_WAYLAND is turned off.

There are some Wayland -dev packages missing, hence Wayland is disabled (see README.Wayland for how to fix this if you like).

-- Found X11: /usr/include
...

-- Configuration Summary for FLTK 1.4.4 generated by CMake 3.31.6 --

-- The following OPTIONAL packages have been found:

 * ZLIB
 * PNG
 * JPEG

-- The following OPTIONAL packages have not been found:

 * Doxygen

-- Static libraries    will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- Shared libraries    will not be built (set FLTK_BUILD_SHARED_LIBS=ON to build)
-- The forms library   will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- The OpenGL library  will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- fluid               will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin
-- fltk-options        will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin
-- Test programs       will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin/test
-- Example programs    will not be built (set FLTK_BUILD_EXAMPLES=ON to build)
--
-- Build configuration      <unspecified>
-- Installation prefix      /usr/local

-- Bundled Libraries        JPEG     = System: /usr/lib/x86_64-linux-gnu/libjpeg.so
--                          PNG      = System: /usr/lib/x86_64-linux-gnu/libpng.so
--                          ZLIB     = System: /usr/lib/x86_64-linux-gnu/libz.so

-- Use Wayland              No (X11 is used)
-- All drawing uses Cairo   No
-- Use Pango                No

Since Wayland is disabled, Cairo drawing is disabled as well, and your build uses standard X11 graphics.
That's not bad per se, but it's not "the same" as the Debian (hybrid) FLTK library would provide.

Anyway, ...


compile it...
andre@debian:~/development/FLTK/LibBuild-1.4/fltk-branch-1.4$ cmake --build ../build
...
[100%] Linking CXX executable ../bin/test/shape
[100%] Built target shape
[100%] Building CXX object test/CMakeFiles/shadow_variables.dir/shadow_variables.cxx.o
[100%] Linking CXX executable ../bin/test/shadow_variables
[100%] Built target shadow_variables

And none of the problems reported.

Tried a number of the test programs, sudoku works fine, somehow doublebuffer is very pleasing to my eyes.

Good so far.


Back to the test program. I deviated from the proposed CMakeLists.txt file by adding FLTK_DIR in the file,. (Should have done this as a command line argument.)

Good, and yes, setting a CMake variable (in the cache) is the recommended way.
Great!


fltk-versions runs fine but does not do very much.

Yep, it's almost the same as a simple hello-world, but displays the respective FLTK version numbers. That's all it's intended to do.


It seems I have something going this time.


Please test, and ideally confirm that this works for you so we can add this to our docs.

Done with pleasure.

Thank you very, very much!

If you still like to test my patch, that'd be appreciated. 

Andre Steenveld

unread,
Jan 10, 2026, 4:19:07 PM (12 days ago) Jan 10
to fltk.general
Found some simpe code for testing on the internet. Added a button to main.cpp and tried that.
Works without problems, can push the button.

Note that FLTK-v1.4.3 is still installed but not used.

If anyting else is needed I'm willing to test a bit more.



#include <FL/Fl.H>
#include <FL/Fl_Window.H>       /* FLTK window     FLTK  */
#include <FL/Fl_Button.H>       /* FLTK button     FLTK  */

#include <stdio.h>              /* I/O lib         ISOC  */
#include <stdlib.h>             /* Standard Lib    ISOC  */

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static void daButCall(Fl_Widget *w, void *uData)
{
  printf("The button was pressed\n");
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
  Fl_Window win(500, 70, "Simple Button Demo Program");
  Fl_Button but(20, 20, 460, 30, "Test Button");
  but.callback(daButCall, (void *)0);
  win.show();
  return Fl::run();
}


Andre Steenveld

unread,
Jan 10, 2026, 4:27:59 PM (12 days ago) Jan 10
to fltk.general


Op zaterdag 10 januari 2026 om 22:17:20 UTC+1 schreef Albrecht-S:
On 1/10/26 21:58 Andre Steenveld wrote:
and now for part two (have success this time.)

Great, thanks!

Your welcome. Without your help I could not have done it.
 

But ... there's always a (tiny) "but", isn't it? No need to worry, but see below..
... 
build of v1.4.4
andre@debian:~/development/FLTK/LibBuild-1.4/fltk-branch-1.4$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- ...

All good so far, and here comes the "but", part 1:


-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "62")
-- Checking for module 'wayland-client>=1.18'
--   Package 'wayland-client', required by 'virtual:world', not found
-- Checking for module 'wayland-cursor'
--   Package 'wayland-cursor', required by 'virtual:world', not found
-- Checking for module 'wayland-protocols>=1.15'
--   Package 'wayland-protocols', required by 'virtual:world', not found
-- Checking for module 'xkbcommon'
--   Package 'xkbcommon', required by 'virtual:world', not found
-- Not all software modules 'wayland-client>=1.18 wayland-cursor wayland-protocols>=1.15 xkbcommon' are present
-- Consequently, FLTK_BACKEND_WAYLAND is turned off.

There are some Wayland -dev packages missing, hence Wayland is disabled (see README.Wayland for how to fix this if you like).

What sould I install to tackle this?
 
...

-- Use Wayland              No (X11 is used)
-- All drawing uses Cairo   No
-- Use Pango                No

Since Wayland is disabled, Cairo drawing is disabled as well, and your build uses standard X11 graphics.
That's not bad per se, but it's not "the same" as the Debian (hybrid) FLTK library would provide.
... 
Good so far.
Back to the test program. I deviated from the proposed CMakeLists.txt file by adding FLTK_DIR in the file,. (Should have done this as a command line argument.)

Good, and yes, setting a CMake variable (in the cache) is the recommended way.

In my view on the command line is better. Not everybody will use the same location. I was a bit lazy here.
...

 
If you still like to test my patch, that'd be appreciated. 

I will test your patch.

 

Albrecht Schlosser

unread,
Jan 10, 2026, 4:28:25 PM (12 days ago) Jan 10
to fltkg...@googlegroups.com
On 1/10/26 22:19 Andre Steenveld wrote:
> Found some simpe code for testing on the internet. Added a button to
> main.cpp and tried that.
> Works without problems, can push the button.

Hint: if you like to test and learn more: there are a lot of test and
demo programs included in the FLTK distribution in /test/ and /examples/
folders. Most of these demo programs consist of a single source file
which can be built easily either by using `fltk-config --compile` or
something like your CMakeLists.txt file.

> Note that FLTK-v1.4.3 is still installed but not used.

OK, but this can constitute a problem. On some systems there can be
conflicts between the FLTK version you're going to build and one
installed on the system. Since you tried built a very similar version
there's usually no problem, but if you tried to build FLTK 1.5 and had
1.4 (or even 1.3 dev files installed), then this could cause problems --
on some systems like OpenBSD, for some yet unclear differences in the
CMake build process. Debian is not known to cause such problems though.

> If anyting else is needed I'm willing to test a bit more.

Yes, if you like: as I wrote before, I'd appreciate if you could also
test my patch I posted recently. But note that you need to change a
system file with root access. TIA

Albrecht Schlosser

unread,
Jan 10, 2026, 4:33:27 PM (12 days ago) Jan 10
to fltkg...@googlegroups.com
On 1/10/26 22:27 Andre Steenveld wrote:
Op zaterdag 10 januari 2026 om 22:17:20 UTC+1 schreef Albrecht-S:
There are some Wayland -dev packages missing, hence Wayland is disabled (see README.Wayland for how to fix this if you like).

What sould I install to tackle this?
 

See README.Wayland.txt in the FLTK distro, chapter 3.1 (cited here for completeness):
```
These packages are necessary to build the FLTK library, in addition to those listed
in section 2.1 of file README.Unix.txt :

  sudo apt-get install libpango1.0-dev
  sudo apt-get install libwayland-dev
  sudo apt-get install wayland-protocols
  sudo apt-get install libxkbcommon-dev
  sudo apt-get install libxinerama-dev  # except if option FLTK_BACKEND_X11=off is used
  sudo apt-get install libdbus-1-dev    # recommended to query current cursor theme
  sudo apt-get install libglew-dev      # necessary to use OpenGL version 3 or above
  sudo apt-get install libdecor-0-dev   # recommended if available and if in version ≥ 0.2.0
  sudo apt-get install libgtk-3-dev     # highly recommended if libdecor-0-dev is not installed

These packages allow to run FLTK apps under the Gnome-Wayland desktop:

  sudo apt-get install gnome-core
  sudo apt-get install libdecor-0-plugin-1-gtk  # install if libdecor-0-dev is installed

These packages allow to run FLTK apps under the KDE/Plasma-Wayland desktop:

  sudo apt-get install kde-plasma-desktop
```




Andre Steenveld

unread,
Jan 11, 2026, 5:35:07 AM (12 days ago) Jan 11
to fltk.general


Op zaterdag 10 januari 2026 om 21:57:07 UTC+1 schreef Albrecht-S:
On 1/10/26 21:16 Andre Steenveld wrote:

... 
 
To apply my patch you need to replace (as root!) the file /usr/share/fltk/FLTK-Targets-none.cmake with the one I attach to this mail. Please backup the original file before you replace it.

I hope this helps, finally.

To verify that this was the real cause I reinstalled the original libfltk1.4-dev package, found the same issues you reported, and applied my patch which resolved the issue again.

It does not work on my installation. Here is what I did.

First I updated all packages according to the README files.
Then I did a rebuild on v1.4.4 to check what the build would be.

andre@debian:~/development/FLTK/LibBuild-1.4/fltk-branch-1.4$ cmake -S . -B ../build --fresh

-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Looking for POSIX compatible scandir
-- POSIX compatible scandir - found
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3.1")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.48")
-- Looking for png.h
-- Looking for png.h - found
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "62")
-- Checking for module 'wayland-client>=1.18'
--   Found wayland-client, version 1.23.1

-- Checking for module 'wayland-cursor'
--   Found wayland-cursor, version 1.23.1

-- Checking for module 'wayland-protocols>=1.15'
--   Found wayland-protocols, version 1.44

-- Checking for module 'xkbcommon'
--   Found xkbcommon, version 1.7.0

-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Checking for module 'wayland-egl'
--   Found wayland-egl, version 18.1.0
-- Checking for module 'egl'
--   Found egl, version 1.5
-- Checking for module 'gl'
--   Found gl, version 1.2
-- Checking for module 'glu'
--   Found glu, version 9.0.2

-- Looking for glXGetProcAddressARB
-- Looking for glXGetProcAddressARB - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Checking for module 'cairo'
--   Found cairo, version 1.18.4
-- Checking for module 'pangoxft'
--   Found pangoxft, version 1.56.3
-- Checking for module 'pangocairo'
--   Found pangocairo, version 1.56.3
-- Checking for module 'dbus-1'
--   Found dbus-1, version 1.16.2


-- Configuration Summary for FLTK 1.4.4 generated by CMake 3.31.6 --

-- The following OPTIONAL packages have been found:

 * ZLIB
 * PNG
 * JPEG

-- The following OPTIONAL packages have not been found:

 * Doxygen

-- Static libraries    will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- Shared libraries    will not be built (set FLTK_BUILD_SHARED_LIBS=ON to build)
-- The forms library   will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- The OpenGL library  will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/lib
-- fluid               will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin
-- fltk-options        will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin
-- Test programs       will be built in: /home/andre/development/FLTK/LibBuild-1.4/build/bin/test
-- Example programs    will not be built (set FLTK_BUILD_EXAMPLES=ON to build)
--
-- Build configuration      <unspecified>
-- Installation prefix      /usr/local

-- Bundled Libraries        JPEG     = System: /usr/lib/x86_64-linux-gnu/libjpeg.so
--                          PNG      = System: /usr/lib/x86_64-linux-gnu/libpng.so
--                          ZLIB     = System: /usr/lib/x86_64-linux-gnu/libz.so
--                          Libdecor = System: /usr/lib/x86_64-linux-gnu/libdecor-0.so
-- Use DBUS                 Yes

-- Use Wayland              Yes (can also run as X11 client)
-- All drawing uses Cairo   Yes
-- Use Pango                Yes

-- Fl_Cairo_Window support  No
-- Use std::                No

-- End of Configuration Summary --

-- Configuring done (16.0s)
-- Generating done (2.2s)
-- Build files have been written to: /home/andre/development/FLTK/LibBuild-1.4/build
andre@debian:~/development/FLTK/LibBuild-1.4/fltk-branch-1.4$

Before I updated the cmake script I checked once more if generating a build with v1.4.3 is working or not.
As expected that did not work.
After that I updated the scrip by moving the original one out of the way and copying the new one and checking permissions.

andre@debian:/usr/share/fltk$ ls -la
total 84
drwxr-xr-x   2 root root  4096 Jan 11 11:18 .
drwxr-xr-x 260 root root 12288 Jan 11 11:03 ..
-rw-r--r--   1 root root   255 Apr 30  2025 CMakeCache.txt
-rw-r--r--   1 root root  5009 Apr 30  2025 FLTKConfig.cmake
-rw-r--r--   1 root root  3214 Apr 30  2025 FLTKConfigVersion.cmake
-rw-r--r--   1 root root  2931 Apr 29  2025 FLTK-Functions.cmake
-rw-r--r--   1 root root 14671 Apr 30  2025 FLTK-Targets.cmake
-rw-r--r--   1 root root 15013 Jan 11 11:18 FLTK-Targets-none.cmake
-rw-r--r--   1 root root 14979 Apr 30  2025 FLTK-Targets-none.org.cmake
andre@debian:/usr/share/fltk$

Then another try, this time it failed with more comments.

andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:29 (add_library):
  add_library cannot create imported target "fltk::cairo" because another

  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:92 (add_library):
  add_library cannot create imported target "fltk::fltk" because another

  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:115 (add_library):
  add_library cannot create imported target "fltk::forms" because another

  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:138 (add_library):
  add_library cannot create imported target "fltk::images" because another

  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:161 (add_library):
  add_library cannot create imported target "fltk::gl" because another target

  with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:192 (add_library):

  add_library cannot create imported target "fltk::fluid" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:222 (add_library):

  add_library cannot create imported target "fltk::options" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:243 (add_library):
  add_library cannot create imported target "fltk::blocks" because another

  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:264 (add_library):
  add_library cannot create imported target "fltk::checkers" because another

  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:285 (add_library):
  add_library cannot create imported target "fltk::sudoku" because another

  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:306 (add_library):
  add_library cannot create imported target "fltk::glpuzzle" because another

  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


CMake Error at /usr/share/fltk/FLTK-Targets.cmake:181 (message):
  The imported target "fltk::fluid-shared" references the file

     "/usr/bin/fluid-shared"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/share/fltk/FLTK-Targets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)


-- Configuring incomplete, errors occurred!
andre@debian:~/development/FLTK/LibTest/sources$


Note: this happened because I lost track of the patch(es) I had done on my Debian Trixie VM. I apologize for the extra work you need to do now.

No need to appologize.
 
Note also that the patch is only a minimal version to resolve the issue, not a complete solution. In a later Debian version this file should hopefully be fixed (overwritten by upgrading the package).

Unfortunately, not working on my system. 

Andre Steenveld

unread,
Jan 11, 2026, 5:41:08 AM (11 days ago) Jan 11
to fltk.general


Op zaterdag 10 januari 2026 om 22:28:25 UTC+1 schreef Albrecht-S:

Hint: if you like to test and learn more: there are a lot of test and
demo programs included in the FLTK distribution in /test/ and /examples/
folders.

I need to make an application that runs on *nix and WIN32, so I need to learn how things are done in FLTK.
Thanks for the tip!
 

> Note that FLTK-v1.4.3 is still installed but not used.

OK, but this can constitute a problem.
...
> If anyting else is needed I'm willing to test a bit more.

Yes, if you like: as I wrote before, I'd appreciate if you could also
test my patch I posted recently. But note that you need to change a
system file with root access. TIA 

Then I will remove v1.4.3 after you are ready with testing for a workaround.

 

Albrecht Schlosser

unread,
Jan 11, 2026, 9:34:27 AM (11 days ago) Jan 11
to fltkg...@googlegroups.com


On 1/11/26 11:35 Andre Steenveld wrote:
Op zaterdag 10 januari 2026 om 21:57:07 UTC+1 schreef Albrecht-S:
On 1/10/26 21:16 Andre Steenveld wrote:

... 
 
To apply my patch you need to replace (as root!) the file /usr/share/fltk/FLTK-Targets-none.cmake with the one I attach to this mail. Please backup the original file before you replace it.

I hope this helps, finally.

To verify that this was the real cause I reinstalled the original libfltk1.4-dev package, found the same issues you reported, and applied my patch which resolved the issue again.

It does not work on my installation. Here is what I did.

That's bad and somehow unexpected (but see below for a comment and suggestion).


First I updated all packages according to the README files.
Then I did a rebuild on v1.4.4 to check what the build would be.

andre@debian:~/development/FLTK/LibBuild-1.4/fltk-branch-1.4$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0


[...] Good, that seems to have worked now.


-- Use Wayland              Yes (can also run as X11 client)
-- All drawing uses Cairo   Yes
-- Use Pango                Yes

That's what we wanted to see, OK.


Before I updated the cmake script I checked once more if generating a build with v1.4.3 is working or not.
As expected that did not work.

Thanks for the report (elided here for brevity).


After that I updated the scrip by moving the original one out of the way and copying the new one and checking permissions.

andre@debian:/usr/share/fltk$ ls -la
total 84
drwxr-xr-x   2 root root  4096 Jan 11 11:18 .
drwxr-xr-x 260 root root 12288 Jan 11 11:03 ..
-rw-r--r--   1 root root   255 Apr 30  2025 CMakeCache.txt
-rw-r--r--   1 root root  5009 Apr 30  2025 FLTKConfig.cmake
-rw-r--r--   1 root root  3214 Apr 30  2025 FLTKConfigVersion.cmake
-rw-r--r--   1 root root  2931 Apr 29  2025 FLTK-Functions.cmake
-rw-r--r--   1 root root 14671 Apr 30  2025 FLTK-Targets.cmake
-rw-r--r--   1 root root 15013 Jan 11 11:18 FLTK-Targets-none.cmake
-rw-r--r--   1 root root 14979 Apr 30  2025 FLTK-Targets-none.org.cmake
andre@debian:/usr/share/fltk$

Does "moving the original one out of the way" mean that you renamed it to "FLTK-Targets-none.org.cmake" ? (I don't have this file on my system.)

I guess that's the cause of the following behavior because CMake includes files with a wildcard:

Then another try, this time it failed with more comments.

andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
...

CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:29 (add_library):
  add_library cannot create imported target "fltk::cairo" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)

As you can see the CMake script includes the old one as well.

Please remove it from this directory to be sure! (Maybe renaming it to 'something.txt' would work as well.)

More error messages like the above one removed.

[...]


Note also that the patch is only a minimal version to resolve the issue, not a complete solution. In a later Debian version this file should hopefully be fixed (overwritten by upgrading the package).

Unfortunately, not working on my system.

Can you give it another try after *removing* the offending file "FLTK-Targets-none.org.cmake"(saving it elsewhere). Note also that you can always reinstall the FLTK package to restore the original file.

Thanks in advance.

Andre Steenveld

unread,
Jan 11, 2026, 11:15:20 AM (11 days ago) Jan 11
to fltk.general


Op zondag 11 januari 2026 om 15:34:27 UTC+1 schreef Albrecht-S:
yes.
 
I guess that's the cause of the following behavior because CMake includes files with a wildcard:

I was not aware of that. And to be honest, I did not check the result thorouhly
Then another try, this time it failed with more comments.

andre@debian:~/development/FLTK/LibTest/sources$ cmake -S . -B ../build --fresh
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
...

CMake Error at /usr/share/fltk/FLTK-Targets-none.org.cmake:29 (add_library):
  add_library cannot create imported target "fltk::cairo" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/share/fltk/FLTK-Targets.cmake:166 (include)
  /usr/share/fltk/FLTKConfig.cmake:39 (include)
  CMakeLists.txt:3 (find_package)

As you can see the CMake script includes the old one as well.

Please remove it from this directory to be sure! (Maybe renaming it to 'something.txt' would work as well.)

I did delete it (kept a copy on another location) Now it all works

andre@debian:~/development/FLTK/LibTest-v1.4.3/sources$ cmake -S . -B ../build --fresh

-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (1.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/andre/development/FLTK/LibTest-v1.4.3/build
andre@debian:~/development/FLTK/LibTest-v1.4.3/sources$ cmake --build ./build
Error: /home/andre/development/FLTK/LibTest-v1.4.3/sources/build is not a directory
andre@debian:~/development/FLTK/LibTest-v1.4.3/sources$ cmake --build ../build

[ 50%] Building CXX object CMakeFiles/fltk-versions.dir/main.cpp.o
[100%] Linking CXX executable fltk-versions
[100%] Built target fltk-versions
andre@debian:~/development/FLTK/LibTest-v1.4.3/sources$

fltk-versions runs without a problem. 

Andre Steenveld

unread,
Jan 11, 2026, 11:21:26 AM (11 days ago) Jan 11
to fltk.general
Op zondag 11 januari 2026 om 15:34:27 UTC+1 schreef Albrecht-S:
...
Can you give it another try after *removing* the offending file "FLTK-Targets-none.org.cmake"(saving it elsewhere). Note also that you can always reinstall the FLTK package to restore the original file.

Thanks in advance.

I can do more testing if you want.
 But if you think all testing is done I would like to continue with removing all of FLTK-v1.4.3, install FLTK-v1.4.4 and see how that behaves.
 

Albrecht Schlosser

unread,
Jan 11, 2026, 11:38:04 AM (11 days ago) Jan 11
to fltkg...@googlegroups.com
On 1/11/26 17:15 Andre Steenveld wrote:
Op zondag 11 januari 2026 om 15:34:27 UTC+1 schreef Albrecht-S:
On 1/11/26 11:35 Andre Steenveld wrote:
It does not work on my installation. Here is what I did.
...
After that I updated the scrip by moving the original one out of the way and copying the new one and checking permissions.

andre@debian:/usr/share/fltk$ ls -la
total 84
drwxr-xr-x   2 root root  4096 Jan 11 11:18 .
drwxr-xr-x 260 root root 12288 Jan 11 11:03 ..
-rw-r--r--   1 root root   255 Apr 30  2025 CMakeCache.txt
-rw-r--r--   1 root root  5009 Apr 30  2025 FLTKConfig.cmake
-rw-r--r--   1 root root  3214 Apr 30  2025 FLTKConfigVersion.cmake
-rw-r--r--   1 root root  2931 Apr 29  2025 FLTK-Functions.cmake
-rw-r--r--   1 root root 14671 Apr 30  2025 FLTK-Targets.cmake
-rw-r--r--   1 root root 15013 Jan 11 11:18 FLTK-Targets-none.cmake
-rw-r--r--   1 root root 14979 Apr 30  2025 FLTK-Targets-none.org.cmake
andre@debian:/usr/share/fltk$
Does "moving the original one out of the way" mean that you renamed it to "FLTK-Targets-none.org.cmake" ? (I don't have this file on my system.)

yes.
 
I guess that's the cause of the following behavior because CMake includes files with a wildcard:

I was not aware of that. And to be honest, I did not check the result thorouhly

Neither was I, but I had a suspicion from some deep parts of my memory.
...

Great, thank you very, very much for your intense testing and feedback. It's always good to know that someone else can reproduce the issue and the fix.

What I learned from this long thread:

(1) My patch works (but as I wrote it's neither complete nor a useful / final solution, it's only a workaround).
(2) We (the FLTK developers) can't rely on Linux maintainers to prepare all FLTK packages correctly for all possible package combinations [1].
(3) We need more work to help maintainers to "do the right thing" [2] [3].

Notes:

[1] This is not meant as an offense, I am aware that building a working distribution with "packages" is a hard job and I appreciate the good job the Linux maintainers are doing to provide FLTK in Linux packages.

[2] I'm thinking of "splitting" the FLTK installation in CMake "components" which will hopefully help maintainers to build their own packages. These components should mirror the typical split in distro packages (libfltk, libfltk-dev, fluid, fltk-options, fltk-games, or whatever).

[3] I learned also from Linux (Debian) package inspection that maintainers renamed our executables (package "games") to more likely unique names (e.g. "blocks" to "flblocks" or similar). We (i.e. I) should consider this.

I'll try to improve FLTK 1.4 as far as possible to prevent the most likely mistakes although I'm not sure that I can do much because I don't know how distro package maintainers build their packages, but I'll try to investigate.

Splitting FLTK installations in "CMake components" will be considered for FLTK 1.5 (not 1.4.x). This has been on my todo list anyway, but now it's more obvious that we need it.

imm

unread,
Jan 11, 2026, 11:45:35 AM (11 days ago) Jan 11
to General FLTK
This is somewhat orthogonal to the config/cmake issues that this thread is about, but the OP said the objective is to build "the same" program for both Windows & Linux.
So I thought it might be handy to throw in a few pointers about that:

Firstly, I'd note that I routinely build for both those targets and it generally Just Works. If you are using OS level features, you do hit the occasional hiccup but some conditional compilation is usually OK. FLTK isn't the problem there.

I always use a self-built FLTK, and setup my builds accordingly. I seldom use the "system" provided FLTK because there isn't one on Windows & over the years I've had issues with distro packaged FLTK on several systems... Always using a local build makes the Windows & Linux builds more congruent anyway which simplifies my builds.

Similarly I use the FLTK bundled PNG, JPEG & zlib, even on Linux, because I can't assume there is a system version on Windows (there usually isn't) and again it makes my builds more uniform between platforms.

--
Ian
From my Fairphone FP3

Albrecht Schlosser

unread,
Jan 11, 2026, 11:47:07 AM (11 days ago) Jan 11
to fltkg...@googlegroups.com
On 1/11/26 17:21 Andre Steenveld wrote:
I can do more testing if you want.
 But if you think all testing is done I would like to continue with removing all of FLTK-v1.4.3, install FLTK-v1.4.4 and see how that behaves.

Thanks, from my point of view it's all clear now, feel free to remove the 1.4.3 packages if you like.

If you really want to "install" FLTK 1.4.4 (or maybe 1.4.5 soon, maybe in 2-3 weeks?) you should be aware of some things:

- some programs provided by Debian will be removed if you remove 1.4.3 (e.g. all the FLTK games demos, but also other applications that depend on FLTK)

- I suggest to try first to install to /usr/local or yet another private space (below your home directory). Don't install to '/usr' directly.

- The default FLTK installation would also install `fluid` and `fltk-options` which are useful tools.

- All test and demo programs will not be installed (but I'm not sure about the "games"). Hint: the easiest thing to experiment is to install to a local (non-system) directory and view the installed directory tree.

Feedback welcome.

Andre Steenveld

unread,
Jan 11, 2026, 12:51:18 PM (11 days ago) Jan 11
to fltk.general


Op zondag 11 januari 2026 om 17:45:35 UTC+1 schreef Ian MacArthur:
This is somewhat orthogonal to the config/cmake issues that this thread is about, but the OP said the objective is to build "the same" program for both Windows & Linux.
So I thought it might be handy to throw in a few pointers about that:

Your advice is much appreciated!
I also have the preference to build packages. And honestly on WIN32 there is not much of a choice.
But confirmation  that this is a good thing to do feels great, thanks.

Maybe worth as a suggestion in the README for the more expericenced users.

Andre Steenveld

unread,
Jan 11, 2026, 12:54:52 PM (11 days ago) Jan 11
to fltk.general


Op zondag 11 januari 2026 om 17:47:07 UTC+1 schreef Albrecht-S:
...

If you really want to "install" FLTK 1.4.4 (or maybe 1.4.5 soon, maybe in 2-3 weeks?) you should be aware of some things:
...
Feedback welcome.

Good advices, thanks. I will provide feedback.
Since this thread is coming to a logical end I will give feedback it in a new thread.
 
Reply all
Reply to author
Forward
0 new messages