[solved] Linker errors after BigSur upgrade

MAC OSX spezifisches Forum
Beiträge, die plattformübergreifend sind, gehören ins 'Allgemein'-Forum.
Benutzeravatar
Kukulkan
Beiträge: 1066
Registriert: 09.09.2004 07:07
Wohnort: Süddeutschland
Kontaktdaten:

[solved] Linker errors after BigSur upgrade

Beitrag 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?
Zuletzt geändert von Kukulkan am 09.06.2021 11:12, insgesamt 1-mal geändert.
babelfish
Beiträge: 57
Registriert: 08.07.2009 10:53

Re: Linker errors after BigSur upgrade

Beitrag von babelfish »

I use 5.73 - everything is ok.
maybe the line - compiler - Xcode - thing?
Hauptsächlich Purebasic für OSX
Benutzeravatar
Kukulkan
Beiträge: 1066
Registriert: 09.09.2004 07:07
Wohnort: Süddeutschland
Kontaktdaten:

Re: Linker errors after BigSur upgrade

Beitrag von Kukulkan »

I just updated and used PB 5.73, but the error is still the same...
Benutzeravatar
Kukulkan
Beiträge: 1066
Registriert: 09.09.2004 07:07
Wohnort: Süddeutschland
Kontaktdaten:

Re: Linker errors after BigSur upgrade

Beitrag 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?
Benutzeravatar
mk-soft
Beiträge: 3695
Registriert: 24.11.2004 13:12
Wohnort: Germany

Re: Linker errors after BigSur upgrade

Beitrag 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:
Alles ist möglich, fragt sich nur wie...
Projekte ThreadToGUI / EventDesigner V3 / OOP-BaseClass-Modul
Downloads auf MyWebspace / OneDrive
Benutzeravatar
Kukulkan
Beiträge: 1066
Registriert: 09.09.2004 07:07
Wohnort: Süddeutschland
Kontaktdaten:

Re: Linker errors after BigSur upgrade

Beitrag 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.
Benutzeravatar
Kukulkan
Beiträge: 1066
Registriert: 09.09.2004 07:07
Wohnort: Süddeutschland
Kontaktdaten:

Re: [solved] Linker errors after BigSur upgrade

Beitrag 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))
Antworten