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

Posted ring1992

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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后编译。

技术图片

 

以上是关于Xcode的一种编译问题:Error: building could produce unreliable results的主要内容,如果未能解决你的问题,请参考以下文章

Mac编译OpenJDK8:configure: error: Xcode 4 is required to build JDK 8, the version found was 10.1config

Mac编译OpenJDK8:configure: error: Xcode 4 is required to build JDK 8, the version found was 10.1config

Xcode build - 停留在编译 Swift 源文件

QT编译错误Error while building/deploying project

QT编译错误Error while building/deploying project

Cordova XCode app build clang error linker command failed on Launch Navigator