2012-03-21 16 views
3

這是打字./configure時我正在錯誤:爲什麼我得到「C編譯器無法創建可執行文件」(在此之前成功編寫C代碼並編譯它)?

checking build system type... x86_64-apple-darwin11.3.0 
checking host system type... x86_64-apple-darwin11.3.0 
checking target system type... x86_64-apple-darwin11.3.0 
checking whether the C compiler works... no 
configure: error: in `/opt/ruby-1.9.3-p125': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 

正如上面是顯而易見的,我試圖編譯Ruby源代碼。我做了一些研究,但似乎沒有人試圖在Lion上自己編譯代碼。我目前正在運行10.7.3 OS X Lion,Macbook Pro。

+0

您是否安裝了[開發人員工具](https://developer.apple.com/xcode/)? – 2012-03-21 20:44:33

+0

也許愚蠢的問題,但'config.log'說什麼? – 2012-03-21 20:47:40

+0

是的,最新的Xcode。我在編譯C程序之前沒有問題,它只是編譯源代碼。這是我第一次,我正在努力學習。 – Andy 2012-03-21 20:48:17

回答

1

如果你有Xcode 4.3+,你是否安裝了命令行工具?您可以從Xcode的偏好設置面板或here下載它們。

+0

hmm,我不確定是否安裝了命令行工具。我會查的。我如何測試我是否做? – Andy 2012-03-21 20:47:27

+0

檢查Xcode首選項。 – 2012-03-21 20:48:52

+0

尋找,但我看不到任何東西,允許我下載它,或者如果我有它。 – Andy 2012-03-21 20:54:03

相關問題