<div dir="ltr">







<p class="gmail-p1">Hello everyone,</p>
<p class="gmail-p1">I’m trying to build the Swift project for the first time and I’m running into a linker error related to MetalKit. I’ve followed the instructions on the Swift Github but the process fails. I’ve run out things I can think of to try, I hope someone can point me in the right direction.</p>
<p class="gmail-p1">I’m running Xcode 9.1 Beta 2 (9B46) on Mac OS 10.12.6 (<a href="http://ci-swift.org">ci-swift.org</a> also uses this version).</p>
<p class="gmail-p1">I’ve tried several things at no avail:</p><p class="gmail-p1">- Install the Xcode beta next to the release version and use xcode-select</p>
<p class="gmail-p1">- Run the build script without options</p>
<p class="gmail-p1">- Removed the build folder and try again several times again with different options (—reconfigure, -x)</p>
<p class="gmail-p1">- Removed both Xcode’s and only install the beta version as Xcode.app, tried to build several times again</p>
<p class="gmail-p1">- Removed my whole swift-source folder, cloned everything again, install Xcode beta again and try to build</p><p class="gmail-p1"><br></p><p class="gmail-p1">When I build the project with -x an Xcode project is generated and I can build some targets, but not everything.</p>
<p class="gmail-p1">I’ve also searched this mailing list and couldn’t find anything I haven’t tried yet.Does anybody have any idea what I could to do to fix this?</p>
<p class="gmail-p2"><br></p>
<p class="gmail-p1">These are the errors I’m seeing when building with ninja and xcodebuild:</p>
<p class="gmail-p1"><br></p><p class="gmail-p1"><b>Build error with Ninja:</b></p>
<p class="gmail-p1">1059/1404] Linking CXX shared library lib/swift/macosx/x86_64/libswiftMetalKit.dylib</p>
<p class="gmail-p1">FAILED: : &amp;&amp; /Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/llvm-macosx-x86_64/./bin/clang++<span class="gmail-Apple-converted-space">  </span>-Wno-unknown-warning-option -Werror=unguarded-availability-new -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -fno-sanitize=all -DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1 -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -dynamiclib -Wl,-headerpad_max_install_names -stdlib=libc++ <span class="gmail-Apple-converted-space">  </span>-target x86_64-apple-macosx10.9 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -arch x86_64 -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/../../../Developer/Library/Frameworks -mmacosx-version-min=10.9 -Wl,-sectcreate,__TEXT,__info_plist,/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/MetalKit/Info.plist -Wl,-application_extension<span class="gmail-Apple-converted-space">  </span>&quot;-L/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64&quot; &quot;-L/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./bin/../lib/swift/macosx/x86_64&quot; &quot;-L/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/./bin/../lib/swift/macosx&quot; -o lib/swift/macosx/x86_64/libswiftMetalKit.dylib -install_name @rpath/libswiftMetalKit.dylib stdlib/public/SDK/MetalKit/macosx/x86_64/MetalKit.o -L/Users/ericblendle/Developer/swift-source/build/Ninja-DebugAssert/llvm-macosx-x86_64/./lib -weak_framework Metal lib/swift/macosx/x86_64/libswiftAppKit.dylib lib/swift/macosx/x86_64/libswiftCoreData.dylib lib/swift/macosx/x86_64/libswiftModelIO.dylib lib/swift/macosx/x86_64/libswiftQuartzCore.dylib lib/swift/macosx/x86_64/libswiftsimd.dylib -framework CoreData lib/swift/macosx/x86_64/libswiftCoreImage.dylib lib/swift/macosx/x86_64/libswiftMetal.dylib -weak_framework Metal -framework QuartzCore lib/swift/macosx/x86_64/libswiftXPC.dylib -framework AppKit lib/swift/macosx/x86_64/libswiftFoundation.dylib lib/swift/macosx/x86_64/libswiftCoreGraphics.dylib -framework CoreGraphics lib/swift/macosx/x86_64/libswiftIOKit.dylib lib/swift/macosx/x86_64/libswiftCoreFoundation.dylib lib/swift/macosx/x86_64/libswiftCore.dylib -framework Foundation lib/swift/macosx/x86_64/libswiftSwiftOnoneSupport.dylib lib/swift/macosx/x86_64/libswiftDarwin.dylib -framework CoreFoundation lib/swift/macosx/x86_64/libswiftDispatch.dylib -framework IOKit lib/swift/macosx/x86_64/libswiftObjectiveC.dylib -weak_framework ModelIO &amp;&amp; :</p>
<p class="gmail-p1">Undefined symbols for architecture x86_64:</p>
<p class="gmail-p1"><span class="gmail-Apple-converted-space">  </span>&quot;_MTKMetalVertexDescriptorFromModelIOWithError&quot;, referenced from:</p>
<p class="gmail-p1"><span class="gmail-Apple-converted-space">      </span>__T08MetalKit44MTKMetalVertexDescriptorFromModelIOWithErrorSo09MTLVertexE0CSgSo09MDLVertexE0CKF in MetalKit.o</p>
<p class="gmail-p1"><span class="gmail-Apple-converted-space">  </span>&quot;_MTKModelIOVertexDescriptorFromMetalWithError&quot;, referenced from:</p>
<p class="gmail-p1"><span class="gmail-Apple-converted-space">      </span>__T08MetalKit030MTKModelIOVertexDescriptorFromA9WithErrorSo09MDLVertexE0CSo09MTLVertexE0CKF in MetalKit.o</p>
<p class="gmail-p1"><span class="gmail-Apple-converted-space">  </span>&quot;_OBJC_CLASS_$_MTKMesh&quot;, referenced from:</p>
<p class="gmail-p1"><span class="gmail-Apple-converted-space">      </span>objc-class-ref in MetalKit.o</p>
<p class="gmail-p1">ld: symbol(s) not found for architecture x86_64</p>
<p class="gmail-p1">clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)</p>
<p class="gmail-p1">[1059/1404] Building CXX object stdlib/public/SDK/XCTest/CMakeFiles/swiftXCTest-macosx-x86_64.dir/XCTestCaseAdditions.mm.o</p>
<p class="gmail-p1">ninja: build stopped: subcommand failed.</p>
<p class="gmail-p1">swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting</p>
<p class="gmail-p2"><br></p>
<p class="gmail-p2"><br></p>
<p class="gmail-p2"><br></p>
<p class="gmail-p1"><b>Build error with xcodebuild:</b></p><p class="gmail-p1"><b><br></b></p>
<p class="gmail-p1">=== BUILD AGGREGATE TARGET swiftGLKit-macosx OF PROJECT Swift WITH CONFIGURATION Debug ===</p>
<p class="gmail-p2"><br></p>
<p class="gmail-p1">Check dependencies</p>
<p class="gmail-p2"><br></p>
<p class="gmail-p1">Write auxiliary files</p>
<p class="gmail-p1">write-file /Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/GLKit/Swift.build/Debug/swiftGLKit-macosx.build/Script-E3CB4F217BA047A6BB1BE483.sh</p>
<p class="gmail-p1">chmod 0755 /Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/GLKit/Swift.build/Debug/swiftGLKit-macosx.build/Script-E3CB4F217BA047A6BB1BE483.sh</p>
<p class="gmail-p2"><br></p>
<p class="gmail-p1">PhaseScriptExecution CMake\ Rules /Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/GLKit/Swift.build/Debug/swiftGLKit-macosx.build/Script-E3CB4F217BA047A6BB1BE483.sh</p>
<p class="gmail-p1"><span class="gmail-Apple-converted-space">    </span>cd /Users/ericblendle/Developer/swift-source/swift</p>
<p class="gmail-p1"><span class="gmail-Apple-converted-space">    </span>/bin/sh -c /Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/SDK/GLKit/Swift.build/Debug/swiftGLKit-macosx.build/Script-E3CB4F217BA047A6BB1BE483.sh</p>
<p class="gmail-p2"><br></p>
<p class="gmail-p1">** BUILD FAILED **</p>
<p class="gmail-p2"><br></p>
<p class="gmail-p2"><br></p>
<p class="gmail-p1">The following build commands failed:</p>
<p class="gmail-p1"><span class="gmail-Apple-tab-span">        </span>Ld /Users/ericblendle/Developer/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/Debug/lib/swift/macosx/x86_64/libswiftMetalKit.dylib normal x86_64</p>
<p class="gmail-p1">(1 failure)</p>
<p class="gmail-p1">swift/utils/build-script: fatal error: command terminated with a non-zero exit status 65, aborting</p>
<p class="gmail-p2"><br></p></div>