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 Test1; building could produce unreliable results. This usually can be resolved by moving the target's Headers build phase before Compile Sources.
Cycle details:
→ Target 'Test1' has copy command from '/Users/a11/Documents/workspace/workspace_opengl/GlfwTest/lib-macos/libglfw.3.dylib' to '/Users/a11/Library/Developer/Xcode/DerivedData/GlfwTest-fswltakqdftvrjhcuqcxnrfzjoko/Build/Products/Debug/libglfw.3.dylib'
○ Target 'Test1' has link command with output '/Users/a11/Library/Developer/Xcode/DerivedData/GlfwTest-fswltakqdftvrjhcuqcxnrfzjoko/Build/Products/Debug/Test1'

解決方法是更改build system:

在Xcode菜單欄 -> File -> Project Settings,將build system修改為legacy build system,然后clean后編譯。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM