{"id":1839,"date":"2015-06-15T10:47:34","date_gmt":"2015-06-15T08:47:34","guid":{"rendered":"http:\/\/www.flagsoft.com\/cmswp\/?p=1839"},"modified":"2016-10-20T13:07:16","modified_gmt":"2016-10-20T11:07:16","slug":"swift-how-to-compile-your-swift-code","status":"publish","type":"post","link":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/","title":{"rendered":"Swift: How to compile your Swift code"},"content":{"rendered":"<p>You can compile your command line interface Swift code like so:<\/p>\n<pre>$ xcrun swiftc -c fibonacci.swift\u00a0 -F \/System\/Library\/Frameworks -I\/usr\/include\r\n$ xcrun swiftc -o fibonacci fibonacci.o<\/pre>\n<p>&nbsp;<\/p>\n<p>If you also have regular C code, you can do it like the following:<\/p>\n<p>1. Compile regular .m file:<\/p>\n<pre>$ xcrun clang C.m -o C.o -c<\/pre>\n<p>Be sure to import the bridge header .h file<\/p>\n<pre>$ xcrun swiftc -c S.swift -import-objc-header C.h -F \/System\/Library\/Frameworks -I\/usr\/include<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>What's the SDK path?<\/p>\n<pre>$ xcrun --show-sdk-path\r\n\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs\/MacOSX10.10.sdk<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can compile your command line interface Swift code like so: $ xcrun swiftc -c fibonacci.swift\u00a0 -F \/System\/Library\/Frameworks -I\/usr\/include $ xcrun swiftc -o fibonacci fibonacci.o &nbsp; 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 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/\"> <span class=\"screen-reader-text\">Swift: How to compile your Swift code<\/span> Weiterlesen &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[9],"tags":[],"class_list":["post-1839","post","type-post","status-publish","format-standard","hentry","category-swift"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Swift: How to compile your Swift code - Flagsoft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Swift: How to compile your Swift code - Flagsoft\" \/>\n<meta property=\"og:description\" content=\"You can compile your command line interface Swift code like so: $ xcrun swiftc -c fibonacci.swift\u00a0 -F \/System\/Library\/Frameworks -I\/usr\/include $ xcrun swiftc -o fibonacci fibonacci.o &nbsp; 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 &hellip; Swift: How to compile your Swift code Weiterlesen &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Flagsoft\" \/>\n<meta property=\"article:published_time\" content=\"2015-06-15T08:47:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-10-20T11:07:16+00:00\" \/>\n<meta name=\"author\" content=\"M\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Geschrieben von\" \/>\n\t<meta name=\"twitter:data1\" content=\"M\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/\"},\"author\":{\"name\":\"M\",\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/#\/schema\/person\/01159effaa2678b9655388109ddf07f0\"},\"headline\":\"Swift: How to compile your Swift code\",\"datePublished\":\"2015-06-15T08:47:34+00:00\",\"dateModified\":\"2016-10-20T11:07:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/\"},\"wordCount\":54,\"commentCount\":0,\"articleSection\":[\"Swift\"],\"inLanguage\":\"de-CH\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/\",\"url\":\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/\",\"name\":\"Swift: How to compile your Swift code - Flagsoft\",\"isPartOf\":{\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/#website\"},\"datePublished\":\"2015-06-15T08:47:34+00:00\",\"dateModified\":\"2016-10-20T11:07:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/#\/schema\/person\/01159effaa2678b9655388109ddf07f0\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/#breadcrumb\"},\"inLanguage\":\"de-CH\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.flagsoft.com\/cmswp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Swift: How to compile your Swift code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/#website\",\"url\":\"https:\/\/www.flagsoft.com\/cmswp\/\",\"name\":\"Flagsoft\",\"description\":\"ALPHA Schulmagazin, Byztxt, Strongsdict, Remote Control Cursor for Mac, PictureViewer4Mac, sdspeed free SD Card Reader for Mac OS X, Byztxt Light, 1A Shopping List, Kindle Book Template\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.flagsoft.com\/cmswp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de-CH\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/#\/schema\/person\/01159effaa2678b9655388109ddf07f0\",\"name\":\"M\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-CH\",\"@id\":\"https:\/\/www.flagsoft.com\/cmswp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3eea8d3678df652d127d9fa625eacfd1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3eea8d3678df652d127d9fa625eacfd1?s=96&d=mm&r=g\",\"caption\":\"M\"},\"url\":\"https:\/\/www.flagsoft.com\/cmswp\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Swift: How to compile your Swift code - Flagsoft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/","og_locale":"de_DE","og_type":"article","og_title":"Swift: How to compile your Swift code - Flagsoft","og_description":"You can compile your command line interface Swift code like so: $ xcrun swiftc -c fibonacci.swift\u00a0 -F \/System\/Library\/Frameworks -I\/usr\/include $ xcrun swiftc -o fibonacci fibonacci.o &nbsp; 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 &hellip; Swift: How to compile your Swift code Weiterlesen &raquo;","og_url":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/","og_site_name":"Flagsoft","article_published_time":"2015-06-15T08:47:34+00:00","article_modified_time":"2016-10-20T11:07:16+00:00","author":"M","twitter_card":"summary_large_image","twitter_misc":{"Geschrieben von":"M","Gesch\u00e4tzte Lesezeit":"1 Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/#article","isPartOf":{"@id":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/"},"author":{"name":"M","@id":"https:\/\/www.flagsoft.com\/cmswp\/#\/schema\/person\/01159effaa2678b9655388109ddf07f0"},"headline":"Swift: How to compile your Swift code","datePublished":"2015-06-15T08:47:34+00:00","dateModified":"2016-10-20T11:07:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/"},"wordCount":54,"commentCount":0,"articleSection":["Swift"],"inLanguage":"de-CH","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/","url":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/","name":"Swift: How to compile your Swift code - Flagsoft","isPartOf":{"@id":"https:\/\/www.flagsoft.com\/cmswp\/#website"},"datePublished":"2015-06-15T08:47:34+00:00","dateModified":"2016-10-20T11:07:16+00:00","author":{"@id":"https:\/\/www.flagsoft.com\/cmswp\/#\/schema\/person\/01159effaa2678b9655388109ddf07f0"},"breadcrumb":{"@id":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/#breadcrumb"},"inLanguage":"de-CH","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.flagsoft.com\/cmswp\/swift-how-to-compile-your-swift-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.flagsoft.com\/cmswp\/"},{"@type":"ListItem","position":2,"name":"Swift: How to compile your Swift code"}]},{"@type":"WebSite","@id":"https:\/\/www.flagsoft.com\/cmswp\/#website","url":"https:\/\/www.flagsoft.com\/cmswp\/","name":"Flagsoft","description":"ALPHA Schulmagazin, Byztxt, Strongsdict, Remote Control Cursor for Mac, PictureViewer4Mac, sdspeed free SD Card Reader for Mac OS X, Byztxt Light, 1A Shopping List, Kindle Book Template","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.flagsoft.com\/cmswp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de-CH"},{"@type":"Person","@id":"https:\/\/www.flagsoft.com\/cmswp\/#\/schema\/person\/01159effaa2678b9655388109ddf07f0","name":"M","image":{"@type":"ImageObject","inLanguage":"de-CH","@id":"https:\/\/www.flagsoft.com\/cmswp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3eea8d3678df652d127d9fa625eacfd1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3eea8d3678df652d127d9fa625eacfd1?s=96&d=mm&r=g","caption":"M"},"url":"https:\/\/www.flagsoft.com\/cmswp\/author\/admin\/"}]}},"jetpack_featured_media_url":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"yarpp-thumbnail":false,"slide-thumbnail":false},"uagb_author_info":{"display_name":"M","author_link":"https:\/\/www.flagsoft.com\/cmswp\/author\/admin\/"},"uagb_comment_info":10,"uagb_excerpt":"You can compile your command line interface Swift code like so: $ xcrun swiftc -c fibonacci.swift\u00a0 -F \/System\/Library\/Frameworks -I\/usr\/include $ xcrun swiftc -o fibonacci fibonacci.o &nbsp; 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&hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/posts\/1839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/comments?post=1839"}],"version-history":[{"count":0,"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/posts\/1839\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/media?parent=1839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/categories?post=1839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flagsoft.com\/cmswp\/wp-json\/wp\/v2\/tags?post=1839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}