The fact there's a link error and not a compilation error suggests an incongruency between the macOS conditions used to compile (that is, the version of the SDK used) and the arguments of the link command used:
if symbol OBJC_CLASS$_UTType is needed at link time, it means the source has been compiled with an SDK version of macOS ≥ 11;
it means also that the link option "-framework UniformTypeIdentifiers" necessary to resolve this symbol is missing from the link command.
The adequate link option is defined by CMake by this if statement:
if(NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 20.0.0)) # a.k.a. macOS version ≥ 11.0
Apparently, the cross build gives ${CMAKE_SYSTEM_VERSION} a value < 20 so "-framework UniformTypeIdentifiers" is omitted from the link command.
But this is not congruent with having used a version of the SDK ≥ 11.0 during the compilation step.
Caution: there are 2 distinct numbering systems here: that for macOS (we are now at macOS Sonoma14.x) used for SDKs
and that for Darwin used by CMAKE_SYSTEM_VERSION (macOS 14 corresponds to Darwin 23).
I believe the linux->macos cross-build operation with CMake should control these 2 CMake-defined variables
- CMAKE_OSX_SYSROOT should specify the location or name of the macOS SDK used by the osxcross toolchain in use;
- CMAKE_OSX_DEPLOYMENT_TARGET should indicate the minimum version of a macOS system on which the executable will run (it must be equal or less than the version of the SDK given in CMAKE_OSX_SYSROOT).
See also the cmake doc for more details:
https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_SYSROOT.html#cmake-osx-sysroot
The source code of FLTK takes care of testing the macOS version of the running system and refrains from using symbols
belonging to macOS versions more recent than the running version. Thus, FLTK libraries can be built for recent macOS versions and run
on old macOS systems without problem provided the version given in CMAKE_OSX_DEPLOYMENT_TARGET is met.
--
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/fltkgeneral/GwU31zGU9ao/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/fltkgeneral/b6284760-eb95-4d99-809a-17953abedfbfn%40googlegroups.com.