I’ll be honest and say that I don’t know. I’ve only interacted with the spell check system through a TextArea.
Removing all the stuff that used to come with the OS has two advantages, less maintenance for the macOS engineers and it brings it more inline with iOS, so that once the migration to iOS is complete, there doesn’t need to be a dedicated macOS team. This will help Apple to maintain its high stock price as it will reduce costs.
If this were the case, then surely your declares would work and not report function not found?
Unless… Lemme look at your code again… Ah… I see the problem now, why didn’t I see it earlier, I don’t know and I must apologize for that. Couldn’t see the wood for the tress! The below code will not generate a FNF error, but the dlopen fails and dlerror reports the library is not found.
// --- These declares are part of the System, not hunspell.
// The fact that this worked at all, is the bug!
const systemLibrary = "system"
Declare Function dlopen Lib systemLibrary (name As CString, flags As Int32) As Ptr
Declare Function dlerror Lib systemLibrary () As CString
Declare Function dlclose Lib systemLibrary (handle As Ptr) As Integer
// --- These declares are for the hunspell library
// const hunspellLibrary = "/usr/lib/libhunspell-1.2.dylib"
const hunspellLibrary = "/usr/lib/libhunspell-22.214.171.124.0.dylib" // --- Trying the full name, JIC
Soft Declare Function Hunspell_create lib hunspellLibrary (aff_path As CString, dic_path As CString) As Ptr
Soft Declare Function Hunspell_spell lib hunspellLibrary (obj As Ptr, word As CString) As Integer
Soft Declare Function Hunspell_suggest lib hunspellLibrary (obj As Ptr, ByRef sugs As Ptr, word As CString) As Integer
Soft Declare Sub Hunspell_destroy lib hunspellLibrary (obj As Ptr)
Soft Declare Sub Hunspell_free_list lib hunspellLibrary (obj As Ptr, ByRef sugs As Ptr, count As Integer)
Dim handle As Ptr = dlopen( hunspellLibrary, 1 Or 8)
If handle = Nil Then
Dim exc As New RuntimeException()
exc.Message = dlerror()
if handle <> nil then
// --- In Objective-C closing/releasing an object that doesn't exist can cause a crash.