Swift

Swift: How to compile your Swift code

You can compile your command line interface Swift code like so:

$ xcrun swiftc -c fibonacci.swift  -F /System/Library/Frameworks -I/usr/include
$ xcrun swiftc -o fibonacci fibonacci.o

 

If you also have regular C code, you can do it like the following:

1. Compile regular .m file:

$ xcrun clang C.m -o C.o -c

Be sure to import the bridge header .h file

$ xcrun swiftc -c S.swift -import-objc-header C.h -F /System/Library/Frameworks -I/usr/include

 

 

What's the SDK path?

$ xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk

 

M

Share
Published by
M

Recent Posts

Bibel Patch

Bibel Patch? Was ist das? Bibeln sind Übersetzungen und können auch Fehler enthalten. Nicht jede…

8 Jahren ago

SpeedreaderLTS – Speech Therapy Software for Logopedia

We write letters and words, but we pronounce syllables. With this method every child can…

8 Jahren ago

macOS Sierra – TOP 10 Features you MUST HAVE

macOS Sierra fixes also some tiny little silly bugs which is as good thing. TOP…

8 Jahren ago

Camino Alternative Dodo Browser Mac

Camino Alternative Dodo Browser Mac Click here https://www.flagsoft.com/cmswp/en/software/dodo-browser/ Camino, SeaMonkey, Maxthon Browser, Flock (web browser),…

9 Jahren ago

Real Time Mac Picture and Image Viewer for Event Photographers

Looking for Real Time Picture and Image Viewer for Event Photographers on your Mac? Click…

9 Jahren ago

PictureViewer with Real Time Viewing Event Images WiFi SD Card, eyefi

Real Time Event Photography - Real time pictures over WiFi SD Cards So you take…

9 Jahren ago