Seite 1 von 1

[solved] Linker errors after BigSur upgrade

Verfasst: 08.06.2021 16:54
von Kukulkan
Hi,
I compile using PureBasic 5.71 LTS (x64) on Mac OS. Since I updated to BigSur, I get errors like this:

Code: Alles auswählen

Error: Linker
clang: error: no such file or directory: '/usr/lib/libiconv.2.dylib'
clang: error: no such file or directory: '/System/Library/Frameworks/IOKit.framework/IOKit'
How can I fix this?

Re: Linker errors after BigSur upgrade

Verfasst: 08.06.2021 16:59
von babelfish
I use 5.73 - everything is ok.
maybe the line - compiler - Xcode - thing?

Re: Linker errors after BigSur upgrade

Verfasst: 08.06.2021 17:17
von Kukulkan
I just updated and used PB 5.73, but the error is still the same...

Re: Linker errors after BigSur upgrade

Verfasst: 08.06.2021 17:24
von Kukulkan
I found some code in my sources that may be part of the problem:

Code: Alles auswählen

ImportC "/usr/lib/libiconv.2.dylib"
and

Code: Alles auswählen

ImportC "/System/Library/Frameworks/IOKit.framework/IOKit"
  IOObjectRelease(object.i)
  IORegistryEntryCreateCFProperty(entry.i, key.i, allocator.i, options.i)
  IORegistryEntryFromPath(masterPort.i, path.p-ascii)
EndImport
I believe this is all some workarounds and tricks from previous forum discussions and forum finds.

Is there something I have to change?

Re: Linker errors after BigSur upgrade

Verfasst: 08.06.2021 19:47
von mk-soft
I found this in PB-Forum

Code: Alles auswählen

ImportC "-framework IOKit"
  IOObjectRelease(object.i)
  IORegistryEntryCreateCFProperty(entry.i, key.i, allocator.i, options.i)
  IORegistryEntryFromPath(masterPort.i, path.p-ascii)
EndImport
Hier kannst du in Deutsch schreiben :wink:

Re: Linker errors after BigSur upgrade

Verfasst: 09.06.2021 08:14
von Kukulkan
Oh, man muß die Imports anpassen? Guck ich mir gleich mal an.
mk-soft hat geschrieben: 08.06.2021 19:47 Hier kannst du in Deutsch schreiben :wink:
Ups. Ich dachte ich hätte im englischen Forum geschrieben... Tschuldigung.

Re: [solved] Linker errors after BigSur upgrade

Verfasst: 09.06.2021 11:40
von Kukulkan
Okay. Danke mk-soft für den Hinweis. Damit hab ich die Lösung jetzt gefunden:

In meinem Fall mussten die folgenden ImportC-Anweisungen korrigiert werden:

Code: Alles auswählen

-ImportC "/System/Library/Frameworks/AddressBook.framework/AddressBook"
+ImportC "-framework AddressBook"

-ImportC "/usr/lib/libiconv.2.dylib"
+ImportC "-l iconv"

-ImportC "/System/Library/Frameworks/IOKit.framework/IOKit"
+ImportC "-framework IOKit"
Das Problem ist, dass BigSur die Libs und Frameworks vor den Entwicklern und Anwendungen versteckt. Mehr Details hier:
https://developer.apple.com/documentati ... tes#Kernel
(Kernel -> Known Issues -> New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286))