2017-01-24 1 views
3

Linux에서 Foundation을 사용하는 명령 줄 도구를 빌드하려고합니다.Linux에서 Swift : -static-stdlib -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) 

누군가가 정적 신속한 프로젝트를 빌드하는 방법을 알고 있나요 : 는하지만 그것을 위해 나는 해결책을 찾을 수없는 오류로 실행?

답변

-1

Afaik Foundation은 코코아의 일부이므로 Linux에서는 사용할 수 없습니다. 대신 Glibc를 사용해 보셨습니까? 마찬가지로 here 그것은 표준 라이브러리 기능을 사용할 수 있습니다.

+0

흠, 배열에 기초 자료가 필요합니다. 나는 그것을 발견했다 : https://github.com/apple/swift-corelibs-foundation/ 어쩌면 가치가있다. –

+1

리눅스에서 파운데이션을 사용할 수 있습니다. – Alexander

관련 문제