简体   繁体   English

如何在 Mac 上使用 gfortran 修复“ld:unexpected token:!tapi-tbd-v3 file”?

[英]How do I fix `ld: unexpected token: !tapi-tbd-v3 file` with gfortran on my Mac?

I keep getting this error whenever I try and compile a .f90 file on my Mac Mojave (10.14)每当我尝试在 Mac Mojave (10.14) 上编译 .f90 文件时,我都会收到此错误

collect2: fatal error: ld terminated with signal 11 [Segmentation fault: 11] compilation terminated. collect2:致命错误:ld 以信号 11 [Segmentation fault: 11] 终止,编译终止。 ld: unexpected token: !tapi-tbd-v3 file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64 ld: 意外标记: !tapi-tbd-v3 文件 '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' 用于架构 x86_64

I've tried uninstalling Xcode and command line tools multiple times as well as created a symlink to the *tbd file so it doesn't require the tbd files anymore.我已经多次尝试卸载 Xcode 和命令行工具,并创建了一个指向 *tbd 文件的符号链接,因此它不再需要 tbd 文件。 I've also tried deleting gfortran from my laptop and reinstalling it again but it's still not working.我也试过从我的笔记本电脑中删除 gfortran 并重新安装它,但它仍然无法正常工作。

I don't really know how to go about fixing this problem and I'm also a beginner at this compiler/linker topic.我真的不知道如何解决这个问题,而且我也是这个编译器/链接器主题的初学者。 Any help would be greatly appreciated.任何帮助将不胜感激。

In case you installed gfortran via MacPorts, please uninstall it and install the xcode variant of the ld64 port:如果您通过 MacPorts 安装了 gfortran,请卸载它并安装 ld64 端口的 xcode 变体:

sudo port install ld64 +ld64_xcode 

After this, install gcc (version N) with -s to build it on your local machine:在此之后,使用-s安装 gcc(版本 N)以在本地机器上构建它:

sudo port install libgcc<N> libgcc
sudo port install -s gcc<N>

Unfortunately, I'm not familiar with solutions not using MacPorts.不幸的是,我不熟悉不使用 MacPorts 的解决方案。

After installing macports, the below 2 commands worked for me安装 macports 后,以下 2 个命令对我有用

sudo port -f activate ld64
sudo port install ld64 +ld64_xcode

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ld:架构 x86_64 的 YAML 文件“&lt;…&gt;”中不支持的 Tapi 文件类型“!tapi-tbd” - ld: unsupported tapi file type '!tapi-tbd' in YAML file '<…>' for architecture x86_64 ld:用于 x86_64 的 YAML 文件“/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd”中不支持的tapi 文件类型“!tapi-tbd” - ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for x86_64 cocoapods:遇到意外的版本目录。 我该如何解决? - cocoapods: An unexpected version directory was encountered. How do I fix this? 如何为UILongPressGestureRecognizer修复代码? - How do I fix my code for the UILongPressGestureRecognizer? 如何解决此错误:“ ld:找不到文件:-fobjc-link-runtime” - How to fix this error: “ld: file not found: -fobjc-link-runtime” Mac Mojave更新后:gfortran错误“ ld:找不到-lcrt1.o collect2的库:错误:ld返回1退出状态” - After Mac Mojave update: gfortran error “ld: library not found for -lcrt1.o collect2: error: ld returned 1 exit status” 我该如何解决这个问题:ld:未找到符号 collect2:ld 返回 1 退出状态** - How can i fix this isuue: ld: symbol(s) not found collect2: ld returned 1 exit status** .tbd 文件中没有指定.dylib - There's no .dylib specified in .tbd file 如何在 Mac 上为我的应用分配一种文件类型 - How do assign a type of file to my app on Mac 我如何修复CopyPNG File的错误? - How do i fix this CopyPNG File error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM