开发者

Header imports and includes failing in XCode, cmath, objc-class.h, etc

I keep having issues with including basic headers such as cmath. It is most prevalent when using example projects. Example:

#include <cmath>

for instance gets a file not found, even though I can verify that the SDK I'm using has it:

/Developer/Platforms/iPhoneOS.platform/Developer/SDK开发者_如何学JAVAs/iPhoneOS4.2.sdk/usr/include/c++/4.2.1/tr1/cmath

I can sometimes work around the issue by importing directly to the file, but this doesn't always work.

#include </usr/include/c++/4.2.1/cmath>


What is the extension of your sourcecode file? .m or .mm? If it's .m, the compiler will assume you have a regular objective-C file, whereas .mm would imply an objective-C++ file. If its not a .mm file, the compiler may not be looking for C++ includes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜