objc4-781 源码编译 & 调试

2020-09-07  本文已影响0人  malgee

准备工作:下载objc4相关依赖库


image.png

objc4相关依赖库:Libc,dyld,libauto,libclosure,libdispatch,libpthread,xnu.这些依赖库中包含了Runtime源码库中需要的一些文件.

问题一:unable to find sdk 'macosx.internal

image.png

注意:target中的 objc 和 obc-trampolines都需要更改

image.png

问题二:'sys/reason.h' file not found

image.png
缺失的文件可以通过以下三种方式获取:
step 1. 在根目录创建了一个 MGCommon 文件, 创建 sys 文件, 把 reason.h 文件加入进去,如下图
image.png
step 2. 然后设置文件检索路径:选择 target -> objc -> Build Settings,在工程的 Header Search Paths 中添加搜索路径 $(SRCROOT)/MGCommon
image.png

其他的文件找不到,处理和上面👆处理一样

'mach-o/dyld_priv.h' file not found
'os/lock_private.h' file not found
'os/base_private.h' file not found
'pthread/tsd_private.h' file not found
'System/machine/cpu_capabilities.h' file not found
'os/tsd.h' file not found
'pthread/spinlock_private.h' file not found
'System/pthread_machdep.h' file not found
'CrashReporterClient.h' file not found
'objc-shared-cache.h' file not found
'_simple.h' file not found
'Block_private.h' file not found

'mach-o/dyld_priv.h' file not found

#define DYLD_MACOSX_VERSION_10_11 0x000A0B00
#define DYLD_MACOSX_VERSION_10_12 0x000A0C00
#define DYLD_MACOSX_VERSION_10_13 0x000A0D00
#define DYLD_MACOSX_VERSION_10_14 0x000A0E00

'os/lock_private.h' file not found
'os/base_private.h' file not found

'pthread/tsd_private.h' file not found
'pthread/spinlock_private.h' file not found

'System/machine/cpu_capabilities.h' file not found

os/tsd.h' file not found

'System/pthread_machdep.h' file not found

注:在最新版的macOS 10.15中最新版下载的libc中没有这个h文件,需要下载Libc-583版本

image.png

'CrashReporterClient.h' file not found

'objc-shared-cache.h' file not found

'_simple.h' file not found

上一篇下一篇

猜你喜欢

热点阅读