gfortran在Mac OS X 10.9上不起作用 [英] gfortran doesn't work on Mac OS X 10.9

查看:102
本文介绍了gfortran在Mac OS X 10.9上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Mac更新为OS X 10.9 GM,然后发现gfortran不起作用. 构建任何程序时,它显示:

I updated my Mac to OS X 10.9 GM, then I found that gfortran does not work. When building any program, it shows:

ld: library not found for -lcrt1.10.5.o
collect2: ld return 1

有人知道我该怎么解决吗?

Does anyone know how I might solve this?

推荐答案

此问题是因为OS X 10.9已完全删除了用于查找库crt1.10.5.o的/Developer目录.库已移至新的Xcode目录(确保Xcode也已更新至最新版本5.0.1+).我发现crt1.10.5.o实际上隐藏在/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/S‌DKs/MacOSX10.9.sdk/usr/lib中.我相信应该有一种自动重定向ld的方法,但是我不知道如何.所以现在我正在使用-L标志进行编译.

This problem is because OS X 10.9 has removed the /Developer directory completely where the library crt1.10.5.o used to locate. The libraries have been moved to the new Xcode directory (make sure that Xcode is also updated to the latest version 5.0.1+). I found that crt1.10.5.o is actually hidden deep in here /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/S‌​DKs/MacOSX10.9.sdk/usr/lib. I believe there should be a way to redirect ld automatically, but I do not know how. So for now I am using the -L flag to compile.

gfortran ... -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/S‌​DKs/MacOSX10.9.sdk/usr/lib/

这对我来说是一个临时的解决方案.我也在等待更好的解决方案.

This works for me as a temperary solution. I am also waiting for better solutions to come up.

这篇关于gfortran在Mac OS X 10.9上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆