How to build a swift executable for Linux on macOS How to build a swift executable for Linux on macOS linux linux

How to build a swift executable for Linux on macOS


This just means it couldn't locate the linked library. If your libswiftCore.so located at /usr/lib/swift/linux you can run LD_LIBRARY_PATH=/usr/lib/swift/linux ./<your executable for linux> and it will work like a charm.

You can also set LD_LIBRARY_PATH variable to just execute the binary.