2017-01-24 3 views
3

Ich versuche, ein Befehlszeilenprogramm auf Linux zu erstellen, das Foundation verwendet. Aber ich laufe in einen Fehler, denn das kann ich nicht eine Lösung finden:Swift unter Linux: -static-stdlib kann nicht gefunden -lFoundation

swiftc -static-stdlib Sources/main.swift Sources/array.swift Sources/check.swift 
/usr/bin/ld.gold: error: cannot find -lFoundation 
/tmp/main-3a78a1.o:/tmp/main-3a78a1.o:function main: error: undefined reference to '_TMV10Foundation12CharacterSet' 
/tmp/main-3a78a1.o:/tmp/main-3a78a1.o:function main: error: undefined reference to '_TWPV10Foundation12CharacterSets10SetAlgebraS_' 
/tmp/main-3a78a1.o:/tmp/main-3a78a1.o:function main: error: undefined reference to '_TFE10FoundationSS10componentsfT11separatedByVS_12CharacterSet_GSaSS_' 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Kennt jemand wie statisch ein schnelles Projekt zu bauen?

Antwort

-1

Afaik Foundation ist ein Teil von Cocoa und somit nicht unter Linux verfügbar. Hast du es stattdessen mit Glibc versucht? Wie gesagt, here macht es Standard-Bibliothek Funktionen verfügbar.

+0

hm, ich brauche etwas Foundation Zeug auf Arrays. Ich fand das: https://github.com/apple/swift-corelibs-foundation/ vielleicht einen Versuch wert. –

+1

Foundation ist definitiv auf Linux verfügbar. – Alexander

Verwandte Themen