Skip to content

Instantly share code, notes, and snippets.

@stepanhruda
Created February 23, 2016 15:29
Show Gist options
  • Save stepanhruda/53b6e3412160d5480fcb to your computer and use it in GitHub Desktop.
Save stepanhruda/53b6e3412160d5480fcb to your computer and use it in GitHub Desktop.
swiftpm linking problems
$ swift build --init
Creating Package.swift
Creating .gitignore
Creating Sources/
Creating Sources/main.swift
Creating Tests/
$ swift build -v -Xcc -v
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/bin/swiftc --driver-mode=swift -I /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/lib/swift/pm -L /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/lib/swift/pm -lPackageDescription -target x86_64-apple-macosx10.10 /Users/stepanhruda/Documents/swiftpm-test/Package.swift
/usr/bin/xcrun --sdk macosx --show-sdk-path
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/bin/swift-build-tool -v -f /Users/stepanhruda/Documents/swiftpm-test/.build/debug/swiftpm-test.o/llbuild.yaml
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/bin/swiftc -module-name swiftpmtest -incremental -emit-dependencies -emit-module -emit-module-path /Users/stepanhruda/Documents/swiftpm-test/.build/debug/swiftpmtest.swiftmodule -output-file-map /Users/stepanhruda/Documents/swiftpm-test/.build/debug/swiftpm-test.o/swiftpm-test/output-file-map.json -c /Users/stepanhruda/Documents/swiftpm-test/Sources/main.swift -I /Users/stepanhruda/Documents/swiftpm-test/.build/debug -j8 -Onone -g -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I /usr/local/include -D SWIFT_PACKAGE -Xcc -v
Apple clang version 3.8.0 ([email protected]:apple/swift-clang.git 4ca3c7fa283ca1017db85b78d464523cf6ebff96) ([email protected]:apple/swift-llvm.git a7663bb722cf4071fb4d712c1b44e110898e3a34) (based on LLVM 3.8.0)
Target: x86_64-apple-macosx10.10
Thread model: posix
InstalledDir:
ignoring nonexistent directory "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/lib/swift
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/lib/swift/clang/include
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks (framework directory)
End of search list.
Apple clang version 3.8.0 ([email protected]:apple/swift-clang.git 4ca3c7fa283ca1017db85b78d464523cf6ebff96) ([email protected]:apple/swift-llvm.git a7663bb722cf4071fb4d712c1b44e110898e3a34) (based on LLVM 3.8.0)
Target: x86_64-apple-macosx10.10
Thread model: posix
InstalledDir:
ignoring nonexistent directory "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/lib/swift
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/lib/swift/clang/include
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks (framework directory)
End of search list.
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/bin/swiftc -o /Users/stepanhruda/Documents/swiftpm-test/.build/debug/swiftpm-test /Users/stepanhruda/Documents/swiftpm-test/.build/debug/swiftpm-test.o/Sources/main.swift.o -target x86_64-apple-macosx10.10 -Xlinker -all_load -g -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/usr/local/lib
Undefined symbols for architecture x86_64:
"__TFSSCfT21_builtinStringLiteralBp8byteSizeBw7isASCIIBi1__SS", referenced from:
_main in main.swift.o
"__TFs5printFTGSaP__9separatorSS10terminatorSS_T_", referenced from:
_main in main.swift.o
"__TIFs5printFTGSaP__9separatorSS10terminatorSS_T_A0_", referenced from:
_main in main.swift.o
"__TIFs5printFTGSaP__9separatorSS10terminatorSS_T_A1_", referenced from:
_main in main.swift.o
"__TMSS", referenced from:
_main in main.swift.o
"__TTSg5P____TFs27_allocateUninitializedArrayurFBwTGSax_Bp_", referenced from:
_main in main.swift.o
"__TZvOs7Process11_unsafeArgvGSpGSpVs4Int8__", referenced from:
_main in main.swift.o
"__TZvOs7Process5_argcVs5Int32", referenced from:
_main in main.swift.o
ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 1 command failures
error: exit(1): ["/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a.xctoolchain/usr/bin/swift-build-tool", "-v", "-f", "/Users/stepanhruda/Documents/swiftpm-test/.build/debug/swiftpm-test.o/llbuild.yaml"]
@kostiakoval
Copy link

What is your swift version?

swift --version
Apple Swift version 3.0-dev (LLVM a7663bb722, Clang 4ca3c7fa28, Swift 1c2f40e246)
Target: x86_64-apple-macosx10.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment