Xcode的一种编译问题:Error: building could produce unreliable results

xcode 11.0在使用libusb开发的时候,编译的过程中经常会出现以下错误,每次都必须clean才能恢复正常,

根据提示将build phases的Compile Sources直接挪动到最后边,没能解决问题

也有人说Target ->Build Phases下,把Embed APP Extensions移动到列表末尾,能解决问题,但可惜我这里没有用

经过多方查验,发现是从xcode10.0就开始有这个问题了,原因是:

Xcode 10 默认使用的build system是New build system,与Xcode9不同。

Cycle inside USBSN; building could produce unreliable results. This usually can be resolved by moving the target's Headers build phase before Compile Sources.
Cycle details:
→ Target 'USBSN' has link command with output '/Users/jerry.yang/Desktop/USBSN/build/Debug/USBSN'
○ Target 'USBSN' has copy command from '/usr/local/lib/libusb-1.0.0.dylib' to '~/Desktop/USBSN/build/Debug/libusb-1.0.0.dylib'
○ Target 'USBSN' has link command with output '~/Desktop/USBSN/build/Debug/USBSN'

 

解决方法是更该build system:

在Xcode菜单栏 -> File -> Project Settings,将build system修改为legacy build system,然后clean后编译。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

auspark

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值