Wednesday, December 16, 2015

Getting started with Swift on Ubuntu 14.04

Download the swift 2.2 or later from Swift.org offical site.
Extract and set path to the binaries.

export PATH=${PATH}:~/swift-2.2-ubuntu14.04/usr/bin

assuming extracted folder is in home directory (indicated by ~/ ).
Try executing

$ swift --version

If you get error like
libstdc++.so.6: version `GLIBCXX_3.4.18' not found
execute the following commands.
 $ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install libstdc++6-4.7-dev



Finally, verify if the swift is working.

$ swift --version
Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift 778f82939c)
Target: x86_64-unknown-linux-gnu



That's all. Enjoy programming in Swift.




No comments:

Post a Comment