zig1375
zig1375

Reputation: 294

Swift Linux. Error: no such module 'Dispatch'

I use Ubuntu 15.10 I compiled swift-corelibs-libdispatch, get file libdispatch.so But still if I use "import Dispatch" get an error "no such module 'Dispatch'"

How can I add this module to Swift?

Upvotes: 5

Views: 1475

Answers (1)

Anatoli P
Anatoli P

Reputation: 4891

One way to accomplish this would be to set up a system module for libdispatch and use swift build. See https://github.com/apple/swift-package-manager/blob/13d682a63ea01246dd119cd4cf5c8d90c030566d/Documentation/SystemModules.md on how to use system modules. This quesion, Importing a Swift module using a C library, may also come in handy.

I'm sure there are other ways, too. You should be able to use swift interpreter or swift compiler (swiftc), but I can't think of a way to do that off the top of my head.

Upvotes: 2

Related Questions