将OAuth添加到Xcode项目会导致Xcode找不到Foundation头文件(随后出现大量错误)

时间:2010-07-15 15:57:42

标签: iphone xcode oauth build

我正在使用此OAuth lib:http://github.com/jdg/oauthconsumer

将其添加到我的项目时,会导致超过2000个构建错误。这些错误都在Build Results窗口的App_Preficx.pch文件下。

如果您实际上单击了错误,它们实际上包含在每个Foundation Header中。我不会列出所有这些,但这里有几个例子:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:236:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:236: error: expected identifier or '(' before '@' token

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:238:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:238: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:8:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:8: error: expected identifier or '(' before '@' token

您可以看到Xcode似乎无法链接到Foundation或至少无法导入标题。

如果我从Xcode中删除了OAuth,那么一切都很好并编译。

我可以在我的内容中添加搜索路径,但无济于事。

我添加了文档中所需的所有框架,库和搜索路径。

在所有2641个错误中,没有一个能给我带来任何真正的问题。似乎也没有任何后果的警告。

有没有人知道如何找出问题的原因?

2 个答案:

答案 0 :(得分:5)

答案 1 :(得分:0)

您是否已将安全框架libxml2.dylib和搜索路径“$ SDKROOT / usr / include / libxml2”添加到项目中,如README所述?