我在XCode中得到包含未找到的编译错误.我有一个iOS应用程序项目,我使用Objective-c和c ++作为混合.
最初,我在ios项目中创建了一个.h文件和一个.cpp文件.然后,我将.cpp文件重命名为.mm文件.
这是我的.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
Run Code Online (Sandbox Code Playgroud)
TestLog.mm
#include "TestLog.h"
void TestLog::Log(string logMessage)
{
//this->logString->append(logMessage);
}
Run Code Online (Sandbox Code Playgroud)
我错过了什么?我需要将std c ++库添加到targetS吗?与搜索标题路径有关的东西?
我只需要使用字符串类型.
非常感谢提前
嗨,当我用.dSYM文件和崩溃文件运行symbolicatecrash脚本时,它无法象征崩溃文件.这是我得到的;
S Version 5.1 Build 11E53
12 binary images remain after pruning:
Foundation, libsystem_notify.dylib, GraphicsServices, UIKit, shell, WebCore, libc++abi.dylib, libobjc.A.dylib, libdispatch.dylib, libsystem_c.dylib, CoreFoundation, libsystem_kernel.dylib,
($osVersion, $osBuild) = (5.1, 11E53)
$versionPattern = {5.1 (11E53),5.1,11E53}
Symbol directory paths:
Finding Symbols:
.fetching symbol file for Foundation--[undef]
Searching []...-- NO MATCH
Searching in Spotlight for dsym with UUID of 9ac539ad20833d948fcfaaaa62325704
Running mdfind "com_apple_xcode_dsym_uuids == 9AC539AD-2083-3D94-8FCF-AAAA62325704"
@dsym_paths = ( )
@exec_names = ( )
Did not find executable for dsym
## Warning: Can't find any …Run Code Online (Sandbox Code Playgroud) 在我们获得崩溃数据后,有没有办法对崩溃报告进行符号化?
目前,这是我在handleCrashReport方法中所做的事情;
PLCrashReportTextFormat textFormat = PLCrashReportTextFormatiOS;
/* Decode data */
PLCrashReport *crashLog = [[PLCrashReport alloc] initWithData: data error: &error];
if (crashLog == nil) {
NSLog(@"Could not decode crash file :%@", [[error localizedDescription] UTF8String]);
} else {
NSString* report = [PLCrashReportTextFormatter stringValueForCrashReport: crashLog withTextFormat: textFormat];
NSLog(@"Crash log \n\n\n%@ \n\n\n", report);
NSString *outputPath = [documentsDirectory stringByAppendingPathComponent: @"app.crash"];
if (![report writeToFile:outputPath atomically:YES encoding:NSUTF8StringEncoding error:nil]) {
NSLog(@"Failed to write crash report");
} else {
NSLog(@"Saved crash report to: %@", outputPath);
}
}
Run Code Online (Sandbox Code Playgroud)
当我在控制台上打印出来时; 我明白了 …