我試圖在Snow Leopard上編譯Macports - 文件src/macports1.0/get_systemconfiguration_proxies.c
。這#include
小號CoreFoundation/CoreFoundation.h
,這到#include
CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h
#include
小號CoreFoundation/CFBase.h
,該... 嘗試。現在,CoreServices
是一個符號鏈接:gcc包含路徑和符號鏈接
$ ls -l CoreServices
lrwxr-xr-x 1 root wheel 62 Mar 25 17:15 CoreServices -> ../../System/Library/Frameworks/CoreServices.framework/Headers
所以我懷疑我們的目標是去../../System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h
,這是完全正常的事情:
$ ls -l ../../System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h
-rw-r--r-- 1 root wheel 30291 Jun 24 2010 ../../System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h
然而,gcc
不喜歡:
In file included from $INCLUDE/CoreFoundation/CFBase.h:48,
from $INCLUDE/CoreFoundation/CoreFoundation.h:38,
from get_systemconfiguration_proxies.c:42:
$INCLUDE/CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h:20:42: error: CarbonCore/ConditionalMacros.h: No such file or directory
這使我懷疑
(編輯:但Tom Zych指出,我懷疑是錯誤的,因爲我沒有讀完錯誤信息。 嘆氣)
是gcc
可能無法解析符號鏈接,而是過度巧妙摺疊CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h
到Frameworks/CarbonCore.framework/Headers/MacTypes.h
,其中,果然,不存在:
$ ls -l Frameworks/CarbonCore.framework/Headers/MacTypes.h
ls: Frameworks/CarbonCore.framework/Headers/MacTypes.h: No such file or directory
難道我是否正確解釋了錯誤?如果是這樣,是否有任何方法可以將gcc
轉換爲cd
之前的符號鏈接?..
?
$INCLUDE/CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h:20:42: \
error: CarbonCore/ConditionalMacros.h: No such file or directory
看來,它是能夠讀取和開始處理MacTypes.h
,因爲它指的是行號在其中:與
哇,我一直盯着那整整一天,而事實證明我無法讀取錯誤信息到行尾。謝謝! – LSpice 2011-03-26 16:09:20