包含< string>未找到编译错误在Xcode 4.2 [英] Include <string> not found compile error in Xcode 4.2
问题描述
我在XCode中包含未找到编译错误。我有一个iOS应用程序项目,我使用Objective-C和C ++作为混合。
I'm getting include not found compile error in XCode. I have an iOS app project that i use Objective-c and c++ as mix.
最初,我在ios项目中创建了一个.h文件和一个.cpp文件。然后,我将.cpp文件重命名为.mm文件。
Initially, i created one .h file and one .cpp file in my ios project. Then, I renamed the .cpp file to .mm file.
这是我的.h文件;
TestLog.h
TestLog.h
#ifndef CalculatorDemo_TestLog_h
#define CalculatorDemo_TestLog_h
#include <string>
using namespace std;
class TestLog
{
private:
string logString;
public:
void Log(string logMessage);
};
#endif
TestLog.mm
TestLog.mm
#include "TestLog.h"
void TestLog::Log(string logMessage)
{
//this->logString->append(logMessage);
}
我缺少什么?我需要添加std c ++库到我的targetS吗?与搜索标题路径相关的东西?
What am I missing? Do I need to add std c++ library to my targetS? Something related to Search Header Paths?
我只需要使用字符串类型。
I just need to use string type.
推荐答案
看看这里可以帮助你:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/16528-how-include-stl- xcode.html
Take a look here it could help you: http://www.iphonedevsdk.com/forum/iphone-sdk-development/16528-how-include-stl-xcode.html
这篇关于包含< string>未找到编译错误在Xcode 4.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!