环境准备
- 下载objc4-781源码
- 依赖文件下载
![](https://img.haomeiwen.com/i233224/049805dfce6c5ef5.png)
其中除了其中 launchd-106.10 需要在Mac OS X 10.4.4下载,其他的均可以在最新的的版本macOS 10.15中检索到 ( dyld-732.8 / libauto-187 / Libc-1353.11.2 / libclosure-74 / libdispatch-1173.0.3 / libplatform-220 / libpthread-416.11.1 / xnu-6153.11.26 )
编译源码
target的base SDK问题
使用下载的objc4-781源码直接编译会报错如下:
unable to find sdk 'macosx.internal'
![](https://img.haomeiwen.com/i233224/56f8255ceef7d0ae.png)
调整配置:
选择 target -> objc -> Build Settings -> Base SDK -> 选择 macOS 【target中的 objc 和 obc-trampolines都需要更改】
![](https://img.haomeiwen.com/i233224/780fa84acd3130bc.png)
文件查漏补缺
【1】'sys/reason.h' file not found
![](https://img.haomeiwen.com/i233224/c9bce0a7560a6787.png)
在Apple source的 macOS10.15 --> xnu-6153.11.26/bsd/sys/reason.h
路径自行下载
-
在
objc4-781
的根目录下新建CDCommon
文件, 同时在CJLCommon文件中创建sys
文件 -
最后将
reason.h
文件拷贝到sys
文件中
image.png
给工程设置文件检索路径:选择 target
-> objc
-> Build Settings
,在工程的 Header Serach Paths
中添加搜索路径 $(SRCROOT)/CDCommon
![](https://img.haomeiwen.com/i233224/57016d8801c0ded3.png)
【2】'mach-o/dyld_priv.h' file not found
网友评论