一、错误信息
[…]/SandboxProject_62RC3/ios/Pods/Headers/Private/whr-hoye/hoye/portability/Time.h:51:17: Typedef redefinition with different types (‘uint8_t’ (aka ‘unsigned char’) vs ‘enum clockid_t’)
[...]/SandboxProject_62RC3/ios/Pods/Headers/Private/whr-hoye/hoye/portability/Time.h:51:17: Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')
2. Background information
After updating xcode, this error occurs when running the ios project.
3. Treatment method:
I changed __IPHONE_10_0 to __IPHONE_12_0 (because I am now specifying target iOS version 11), and if you are targeting macOS, you can change MAC_OS_X_VERSION_10_12 to MAC_OS_X_VERSION_10_15.
As shown in the figure below, you can directly copy and replace.
// OSX is a pain. The XCode 8 SDK always declares clock_gettime
// even if the target OS version doesn't support it, so you get
// an error at runtime because it can't resolve the symbol. We
// solve that by pretending we have it here in the header and
// then enable our implementation on the source side so that
// gets linked in instead.
#if __MACH__ && \
(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 || \
__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)
#ifdef FOLLY_HAVE_CLOCK_GETTIME
#undef FOLLY_HAVE_CLOCK_GETTIME
#endif
#define FOLLY_HAVE_CLOCK_GETTIME 1
#define FOLLY_FORCE_CLOCK_GETTIME_DEFINITION 1
#endif