Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift Linux. Error: no such module 'Dispatch'

Tags:

swift

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?

like image 571
zig1375 Avatar asked Oct 31 '22 12:10

zig1375


1 Answers

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.

like image 177
Anatoli P Avatar answered Jan 04 '23 13:01

Anatoli P