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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With