Perfect: Swift compiler error

Hello Perfect team, I tried following the README Quick Start instructions.

After I enter the following in Terminal: git clone https://github.com/PerfectlySoft/PerfectTemplate.git cd PerfectTemplate swift build

I get: /Users/matthewtso/git/PerfectTemplate/Packages/PerfectThread-0.10.0/Sources/ThreadQueue.swift:210:97: error: cannot convert value of type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>') to expected argument type 'UnsafeMutablePointer<_>'

/Users/matthewtso/git/PerfectTemplate/Packages/PerfectThread-0.10.0/Sources/ThreadQueue.swift:233:37: error: value of type 'Unmanaged<IsThisRequired>' has no member 'toOpaque'

error: exit(1): /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/matthewtso/git/PerfectTemplate/.build/debug.yaml

Checking my Swift version returns the following: Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24) Target: x86_64-apple-macosx10.9

I’m pretty new and not sure how to diagnose this, is there something I can try to fix this? Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 27 (9 by maintainers)

Most upvoted comments

most of people follow the tutorial :

  1. clone PerfectTemplate and swift build , It works!
  2. Enter swift package generate-xcodeproj in terminal and Open the generated file “PerfectTemplate.xcodeproj” by Xcode IDE ,Ensure that you have selected the executable target and selected it to run on “My Mac” ,It failed!

Solved:

  1. install DEVELOPMENT-SNAPSHOT-2016-06-20-a(the lastest),You could download in swift.org,or install swiftenv firstly,then enter swiftenv install DEVELOPMENT-SNAPSHOT-2016-06-20-a
  2. if you use swiftenv ,then enter swiftenv local DEVELOPMENT-SNAPSHOT-2016-06-20-a in terminal. otherwise just skip;
  3. Xcode -> Preference -> Components->DEVELOPMENT-SNAPSHOT-2016-06-20-a(Not Xcode 8.0); Or Xcode -> Toolchains -> DEVELOPMENT-SNAPSHOT-2016-06-20-a;
  4. Xcode -> Location -> Command Line Tools -> Xode8
  5. clean and build;

Note: Apple official document point out: Selecting a Swift toolchain affects the Xcode IDE only. To use the Swift toolchain with command-line tools, use xcrun --toolchain swift and xcodebuild -toolchain swift, or add the Swift toolchain to your path as follows:

$ export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}"

Hope this could help you