ld: unsupported tapi file type '!tapi-tbd' in YAML file

I'm trying to compile a fortran code on macOS Ventura v 13.1 (22C65) on my MacBook pro (M1) using gfortran.

However, I get the following error when linking:

ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libSystem.tbd' for architecture arm64
collect2: error: ld returned 1 exit status

I have tried

brew upgrade llvm
brew upgrade gcc
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

and also to install a downgrade version from https://developer.apple.com/download/more/, but nothing seems to work. Any suggestions?

Post not yet marked as solved Up vote post of samuelgg Down vote post of samuelgg
4.1k views
  • I am also facing the same issue. I tried those four steps but np luck! I am using ventura 13.4.1 (intel code i9).

Add a Comment

Replies

To start, I recommend that your read An Apple Library Primer, which explains a lot of the backstory.

Errors like this indicate that you have a mismatch between the linker and the SDK. The SDK contains stub libraries (.tbd files) that the linker doesn’t understand. That should never happen with Apple tools because our tools and SDKs are rev-locked. That is, the Xcode 14.1 command-line tools include, and only support, the macOS 13.0 SDK. Something in your setup is trying to ‘cross the streams’ but it’s hard to say what given the number of third-party bits you have in play.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • I have the same problem as samuelgg. How could I find what exactly in my setup is trying to 'cross the streams' ? Where, what could that be ? What can be tried in order to resolve the problem ?

Add a Comment

Do you happen to use Anaconda? I had a similar problem, and noticed that without condo base environment, everything worked fine. Here is the related post.

https://stackoverflow.com/questions/74318052/cant-compile-fortran-on-macos-monterey-ld-unsupported-tapi-file-type-tapi-t

Add a Comment