I am facing a linking issue on macOS. Symbol s1 works as expected, but s2 is not found, although it is in the library and can be found in a test C program.
let cf_handle = Dl.dlopen ~flags:[RTLD_LAZY]
~filename:"/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"
let () =
let s1 = Dl.dlsym ~handle:cf_handle ~symbol:"CFGetTypeID" in
let s2 = Dl.dlsym ~handle:cf_handle ~symbol:"CFByteOrderGetCurrent" in
(* Results in Dl.DL_error("dlsym(0xfff13356d238, CFByteOrderGetCurrent): symbol not found") *)
Printf.eprintf "s1: %i\n" (Nativeint.to_int s1);
Printf.eprintf "s2: %i\n" (Nativeint.to_int s2)
Any ideas why that is and how to resolve it?