iPhone的C++编译(STL问题?)

toa*_*tie 6 c++ iphone xcode stl compilation

我试图将一些C++代码编译为静态库,以便在iPhone上使用.如果我为模拟器(i386架构)编译东西,一切都编译只是很好,但当我将架构切换到arm时,我得到所有这些包含错误,似乎在iPhone SDK STL头文件中.知道发生了什么事吗?

第一个错误:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include/c++/4.2.1/string:45:0 Bits/c++config.h: No such file or directory in 
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include/c++/4.2.1/string
Run Code Online (Sandbox Code Playgroud)

ken*_*ytm 10

添加/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include/c++/4.2.1/armv6-apple-darwin9/为包含路径.

另外,请向Apple提交一个错误.


bva*_*een 7

要修复所有SDK版本的此错误,请添加

$(SDKROOT)/usr/include/c++/4.2.1/armv6-apple-darwin9
Run Code Online (Sandbox Code Playgroud)

到"标题搜索路径"构建设置(架构应该无关紧要;这对我来说仍然适用于模拟器).