sourceCpp 错误:不是 mach-o 或静态库文件 '/usr/local/lib/libgfortran.dylib'

发布于 2025-01-15 06:00:33 字数 518 浏览 1 评论 0原文

我长期以来一直是 RcppArmadillo 的用户,但自从将我的操作系统升级到 Monterey 版本 12.3 以来,一直无法通过 sourceCpp 编译任何程序。

出现以下错误:

ld: malformed universal file: slice content is not mach-o or a static library file '/usr/local/lib/libgfortran.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sourceCpp_2.so] Error 1

根据此处<的帖子判断,这似乎与静态链接与动态链接有关< /a> 但我真的不知道。

I've long been a user of RcppArmadillo, but have been unable to compile any programs via sourceCpp since upgrading my OS to Monterey Version 12.3.

Getting the following error:

ld: malformed universal file: slice content is not mach-o or a static library file '/usr/local/lib/libgfortran.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sourceCpp_2.so] Error 1

It seems like this has something to do with static vs dynamic linking judging by the post here but I really have no idea.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

戴着白色围巾的女孩 2025-01-22 06:00:33

当我升级到 Xcode 13.3 时,我遇到了同样的 ld 错误。我已经恢复到 13.2,并且我的项目构建没有错误。我将继续使用 13.2,直到看到更多有关导致此问题的原因的信息。

I got the same ld error when I upgraded to Xcode 13.3. I've reverted to 13.2 and my projects build with no errors. I'll stay with 13.2 until I see more information coming out on what's causing this problem.

柠檬色的秋千 2025-01-22 06:00:33

重新安装 RcppArmadillo

-> install.packages("RcppArmadillo", type = "source")

如果出现问题,请尝试修改 makeconf 文件:

FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin21/11.2.0
#-L/usr/local/gfortran/lib -lgfortran -lquadmath -lm

Reinstall RcppArmadillo

-> install.packages("RcppArmadillo", type = "source")

If something wrong, try to modify your makeconf file:

FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin21/11.2.0
#-L/usr/local/gfortran/lib -lgfortran -lquadmath -lm

剩余の解释 2025-01-22 06:00:33

这是来自 XCode 13.3 发行说明。我想这个问题与此更改有关。

新的链接修复格式是默认链接方法
面向 macOS 11 或更高版本、iOS 13.4 或更高版本、watchOS 7.0 或更高版本,
和 tvOS 14.0 或更高版本。这种新格式导致 LINKEDIT 更小
二进制文件中的段。当针对较早的操作系统时
发布后,链接器继续生成传统的操作码
LINKEDIT 中的格式用于修复、变基和绑定。 (85572905)

This is from the XCode 13.3 release notes. I guess the issue is related to this change.

The new chained fixups format is the default linking method when
targeting macOS 11 or later, iOS 13.4 or later, watchOS 7.0 or later,
and tvOS 14.0 or later. This new format results in smaller LINKEDIT
segments in binaries. When targeting earlier operating system
releases, the linker continues to generate the traditional opcode
format in LINKEDIT for fixups, rebases, and binds. (85572905)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文