# A Complete Guide to Swift Development on Linux | raywenderlich.com

**URL:** <https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717>\
**Category:** 🎓 Courses & Articles\
**Created:** [April 1, 2020, 10:27pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717 "2020-04-01T22:27:01Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrlotu](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mrlotu/32/96947_2.png) [@mrlotu](https://forums.kodeco.com/u/mrlotu)\
**Post date:** [April 1, 2020, 10:27pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/1 "2020-04-01T22:27:01Z")

</div>

In this tutorial you’ll discover everything you need to start developing Swift on Linux. You’ll learn about LLDB, using SourceKit-LSP, syntax highlighting and the power of autocomplete.

* * *
This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/8325890-a-complete-guide-to-swift-development-on-linux](https://www.raywenderlich.com/8325890-a-complete-guide-to-swift-development-on-linux)

---

<div class="post-metadata">

**Author:** ![bmontegani](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bmontegani/32/105896_2.png) [@bmontegani](https://forums.kodeco.com/u/bmontegani)\
**Post date:** [April 14, 2020, 9:28pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/2 "2020-04-14T21:28:23Z")

</div>

Well it did not build. I have swift version 5.2.1. During the build I got the following message:

/home/bruce/sourcekit-lsp/.build/checkouts/indexstore-db/lib/Support/Concurrencyunknown type name ‘dispatch\_queue\_priority\_t’; did you mean 'dispatch\_queue\_attr

---

<div class="post-metadata">

**Author:** ![mrlotu](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mrlotu/32/96947_2.png) [@mrlotu](https://forums.kodeco.com/u/mrlotu)\
**Post date:** [April 15, 2020, 7:45am UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/3 "2020-04-15T07:45:41Z")

</div>

@bmontegani Hmm, that’s odd. Could you share some more info? Like the exact swift version from `swift --version`, your OS version, what command gave this error and the full stack trace?

That way we can better help figuring out what went wrong. Thanks! :]

---

<div class="post-metadata">

**Author:** ![peacemoon](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/peacemoon/32/107859_2.png) [@peacemoon](https://forums.kodeco.com/u/peacemoon)\
**Post date:** [April 19, 2020, 7:00pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/4 "2020-04-19T19:00:59Z")

</div>

@bmontegani you can try

```auto
swift build -Xcxx -I${HOME}/bin/swift-5.2.2-RELEASE-ubuntu18.04/usr/lib/swift -Xcxx -I${HOME}/bin/swift-5.2.2-RELEASE-ubuntu18.04/usr/lib/swift/Block

```

as stated in the official documentation of the project: [sourcekit-lsp/Development.md at main · apple/sourcekit-lsp · GitHub](https://github.com/apple/sourcekit-lsp/blob/master/Documentation/Development.md)

---

<div class="post-metadata">

**Author:** ![bmontegani](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bmontegani/32/105896_2.png) [@bmontegani](https://forums.kodeco.com/u/bmontegani)\
**Post date:** [April 20, 2020, 5:14pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/5 "2020-04-20T17:14:23Z")

</div>

Thank You.  
BTW… I have noticed that source kit-lsp recommends using the latest development release of Swift. Is this stable enough if I am only doing server side swift?

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 4, 2020, 7:42pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/6 "2020-07-04T19:42:08Z")

</div>

@mrlotu Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![mrlotu](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mrlotu/32/96947_2.png) [@mrlotu](https://forums.kodeco.com/u/mrlotu)\
**Post date:** [July 14, 2020, 7:02am UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/7 "2020-07-14T07:02:07Z")

</div>

@bmontegani As per [Swift’s website](https://swift.org/download/#snapshots):

Development Snapshots are prebuilt binaries that are automatically created from mainline development branches. These snapshots are not official releases. They have gone through automated unit testing, but they have not gone through the full testing that is performed for official releases.

What this means is that you can use them just fine, but I would be careful with. running production code on the snapshots. Usually there isn’t much breaking with them, but they _can_ contain more bugs than the main releases, including big crashes.

Hope this helps :]

---

<div class="post-metadata">

**Author:** ![bpashch](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bpashch/32/106789_2.png) [@bpashch](https://forums.kodeco.com/u/bpashch)\
**Post date:** [July 14, 2020, 9:05pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/8 "2020-07-14T21:05:43Z")

</div>

Hey @mrlotu! Thanks a lot for the guide 🙂 I wonder, does watch variables works in VSCode (or at least where could I enter my `po something`)? Cheers

---

<div class="post-metadata">

**Author:** ![mrlotu](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mrlotu/32/96947_2.png) [@mrlotu](https://forums.kodeco.com/u/mrlotu)\
**Post date:** [July 15, 2020, 8:39am UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/9 "2020-07-15T08:39:39Z")

</div>

Hey @bpashch, awesome to hear you liked the article. When you hit a breakpoint in VSCode you will get access to the lldb console. It should pop up from the bottom or side of the screen. In there you can add `watchpoint`s (see the [LLDB docs](https://lldb.llvm.org/use/map.html#watchpoint-commands) on how) or use your normal `p` and `po` commands 🙂

I am unsure if there are builtin GUI ways in VSCode to add watchpoints, I would suggest looking through the [VSCode debugging documentation](https://code.visualstudio.com/docs/editor/debugging) for this

Hope this helps! :]

---

<div class="post-metadata">

**Author:** ![bpashch](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bpashch/32/106789_2.png) [@bpashch](https://forums.kodeco.com/u/bpashch)\
**Post date:** [July 15, 2020, 6:09pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/10 "2020-07-15T18:09:24Z")

</div>

Hey @mrlotu! Appreciate the response 🙂

Finding that `lldb` window is something that I’m struggling with - could you please perhaps point me to it on my screenshot? Typing `po` anywhere does not seem to work 😬

Cheers ![Screenshot 2020-07-15 at 21.06.31](https://files.chunter.kodeco.com/original/3X/5/3/531d9f56198bb32b40206dc5b28a89610fb995f7.jpeg)

---

<div class="post-metadata">

**Author:** ![mrlotu](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mrlotu/32/96947_2.png) [@mrlotu](https://forums.kodeco.com/u/mrlotu)\
**Post date:** [July 15, 2020, 6:21pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/11 "2020-07-15T18:21:30Z")

</div>

The lldb console is under the `DEBUG CONSOLE` tab (next to the currently selected `Terminal` tab).

Hope this helps! :]

---

<div class="post-metadata">

**Author:** ![bpashch](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bpashch/32/106789_2.png) [@bpashch](https://forums.kodeco.com/u/bpashch)\
**Post date:** [July 15, 2020, 6:25pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/12 "2020-07-15T18:25:03Z")

</div>

@mrlotu I don’t seem to have luck with that one either 🤔 ![Screenshot 2020-07-15 at 21.23.47](https://files.chunter.kodeco.com/original/3X/a/5/a5ff2365758c606e1ac9207c0a8185cf0742dbbb.jpeg)

also attaching my `launch.json` just in case…  
 ![Screenshot 2020-07-15 at 21.26.27](https://files.chunter.kodeco.com/original/3X/5/1/51d7eb91656d9ba81bc11206d3b449e94cd4acb5.jpeg)

---

<div class="post-metadata">

**Author:** ![kvyb](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kvyb/32/81494_2.png) [@kvyb](https://forums.kodeco.com/u/kvyb)\
**Post date:** [July 16, 2020, 4:29pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/13 "2020-07-16T16:29:38Z")

</div>

Doesn’t build on Ubuntu 20.04:  
‘swift-nio-ssl-support’ openssl.pc: warning: couldn’t find pc file

Swift version 5.2.4 (swift-5.2.4-RELEASE)  
Target: x86\_64-unknown-linux-gnu

Any help much appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![bpashch](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bpashch/32/106789_2.png) [@bpashch](https://forums.kodeco.com/u/bpashch)\
**Post date:** [July 28, 2020, 2:45pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/14 "2020-07-28T14:45:24Z")

</div>

@kvyb is this perhaps somewhat related? [Update to Swift 5.0.1 breaks builds on Ubuntu 18/04 · Issue #138 · apple/swift-docker · GitHub](https://github.com/apple/swift-docker/issues/138)

---

<div class="post-metadata">

**Author:** ![bpashch](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bpashch/32/106789_2.png) [@bpashch](https://forums.kodeco.com/u/bpashch)\
**Post date:** [July 28, 2020, 2:46pm UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/15 "2020-07-28T14:46:25Z")

</div>

@mrlotu is there any obvious problem you could probably point out on my screenshots above? Thanks

---

<div class="post-metadata">

**Author:** ![dolar11](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dolar11/32/81494_2.png) [@dolar11](https://forums.kodeco.com/u/dolar11)\
**Post date:** [December 20, 2020, 1:51am UTC](https://forums.kodeco.com/t/a-complete-guide-to-swift-development-on-linux-raywenderlich-com/103717/16 "2020-12-20T01:51:31Z")

</div>

I run `swift run` and got this message at the end:

```
warning: dependency 'SQLite' is not used by any target
'swift-nio-ssl-support' openssl.pc: warning: couldn't find pc file
/home/dolar/Downloads/Compressed/Todos/Starter/.build/checkouts/swift-nio-ssl/Sources/CNIOOpenSSL/shims.c:16:
/home/dolar/Downloads/Compressed/Todos/Starter/.build/checkouts/swift-nio-ssl/So:17:10: fatal error: 'openssl/conf.h' file not found

         ^ ~~~~~~~~~~~~~~~
 generated.
[0/50] Compiling CNIOSHA1 c_nio_sha1.c

```

Then I run $ curl http://localhost:8080` and got this message:

`curl: (7) Failed to connect to localhost port 8080: Connection refused`

I am new to Ubuntu, But I was able to install swift succesfully by following the official link of swift.

Swift version 5.3.2 (swift-5.3.2-RELEASE)  
Ubuntu 20.04.1 LTS
