gcc 包括路径和符号链接
我正在尝试在 Snow Leopard 上编译 Macports,特别是文件 src/macports1.0/get_systemconfiguration_proxies.c
。这个#include
是CoreFoundation/CoreFoundation.h
,其中#include
是CoreFoundation/CFBase.h
,其中... 尝试#include
CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h
。现在, CoreServices 是一个符号链接:
$ 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
'ing 到 ..
之前跟随符号链接吗?
I am trying to compile Macports on Snow Leopard—specifically, the file src/macports1.0/get_systemconfiguration_proxies.c
. This #include
s CoreFoundation/CoreFoundation.h
, which #include
s CoreFoundation/CFBase.h
, which … tries to #include
CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h
. Now, CoreServices
is a symlink:
$ ls -l CoreServices
lrwxr-xr-x 1 root wheel 62 Mar 25 17:15 CoreServices -> ../../System/Library/Frameworks/CoreServices.framework/Headers
so I suspect that the goal is to get to ../../System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacTypes.h
, which is a perfectly fine thing to do:
$ 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
However, gcc
doesn't like it:
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
which leads me to suspect
(EDIT: But Tom Zych points out that I suspect wrongly, because I didn't finish reading the error message. Sigh.)
that gcc
may not be resolving the symlink, and instead over-smartly collapsing CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h
to Frameworks/CarbonCore.framework/Headers/MacTypes.h
, which, sure enough, doesn't exist:
$ ls -l Frameworks/CarbonCore.framework/Headers/MacTypes.h
ls: Frameworks/CarbonCore.framework/Headers/MacTypes.h: No such file or directory
Is it possible that I have interpreted the error correctly? If so, is there any way to talk gcc
into following the symlink before cd
'ing to ..
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
错误消息以以下内容结尾:
看来它能够读取并开始处理
MacTypes.h
,因为它引用了其中的行号。它找不到的文件是CarbonCore/ConditionalMacros.h
。我猜
CarbonCore
应该是CarbonCore.framework
。我不知道为什么这个问题很久没有出现并得到解决。也许这是最近的变化。The error message ends with:
It appears that it was able to read and start processing
MacTypes.h
, since it's referring to line numbers therein. The file it can't find isCarbonCore/ConditionalMacros.h
.I would guess
CarbonCore
should beCarbonCore.framework
. Why this hasn't long since come up and been fixed, I don't know. Perhaps it's a recent change.