尝试调用系统库中不存在的符号(llvm_gcda_start_file)

时间:2012-08-28 03:35:13

标签: ios5 code-coverage xcode4.4

我正在尝试按照XCode - Code Coverage?Code Coverage on Xcode 4.4.1

中的说明操作

.gcno文件是在DerivedData中生成的,但我无法生成.gcda文件。当我按下主页按钮时,日志会显示:

Detected an attempt to call a symbol in system libraries that is not present on the iPhone: 
fopen$UNIX2003 called from function llvm_gcda_start_file in image MyApp. 
(lldb)

1 个答案:

答案 0 :(得分:1)

根据Xcode Code Coverage and fopen$UNIX2003Code coverage with Xcode 4.2 - Missing files

将以下内容作为.m文件添加到项目中:

#include <stdio.h>

FILE *fopen$UNIX2003( const char *filename, const char *mode )
{
    return fopen(filename, mode);
}

size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )
{
    return fwrite(a, b, c, d);
}