问题
I'm trying to follow the instructions in XCode - Code Coverage? and Code Coverage on Xcode 4.4.1
The .gcno files are generated in DerivedData, but I can't get it to generate the .gcda files. When I press the home button the logs say:
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:
As per Xcode Code Coverage and fopen$UNIX2003 and Code coverage with Xcode 4.2 - Missing files
Add the following as a .m file to your project:
#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);
}
来源:https://stackoverflow.com/questions/12152416/attempt-to-call-symbol-that-is-not-present-in-system-libraries-llvm-gcda-start