I’m experiencing some weird behaviour with Fl_native_file_chooser in MacOS 15.4 with FLTK v1.4.2 , installed on my machine using CMake (i.e. cmake .. && make && make install)
Essentially, calling ->show() for the native file chooser causes my program to crash
What is a bit strange, is that an old binary executable of my project that used to work, now no longer works, and currently exhibits this crashing behaviour. In the interim I have upgraded my version of MacOS so this might have something to do with it.
However, the test example associated to native-filechooser.cxx bundled with FLTK works fine.
After a bit of digging I have found that I only get the problem when I build my project with CMake as installed on my machine.
and if nothing is found there, falls back to the -I<somepath> compiler flags.
Non-working Example 2:
If I create a CMakeLists.txt file as follows:
cmake_minimum_required(VERSION 3.15)
set(EXEC_NAME test)
project(${EXEC_NAME})
set(SRCS ./native-filechooser.cxx)
add_executable(${EXEC_NAME} WIN32 MACOSX_BUNDLE ${SRCS})
find_package(FLTK REQUIRED NO_MODULE)
target_include_directories(${EXEC_NAME} PUBLIC ${FLTK_INCLUDE_DIRS})
target_link_libraries(${EXEC_NAME} fltk)
What I would do is turn on the cmake flag that shows the compiler/link command lines
when FLTK builds the app vs. when your cmake file builds it, and carefully compare.
But I still get the same behaviour: it crashes when I build with CMake.
On 4/8/25 7:23 PM, rs wrote:
[..]
So the culprit might be somewhere in the result of running 'make VERBOSE=on' which looks like this
On 4/9/25 1:00 AM, rs wrote:
So it turns out the app bundle is the problem.
[..]
Runs:
<key>CFBundleIdentifier</key>
<string>test</string>
Crashes:
<key>CFBundleIdentifier</key>
<string></string>
I am completely mystified as to why this causes this crashing behaviour, but the minimal CMakeLists.txt file above certainly didn't set it.