theos / sdks

Patched sdks that include private framework tbds
Other
585 stars 205 forks source link

Linker fails on linux #21

Closed XMB5 closed 6 years ago

XMB5 commented 6 years ago

When linking swift code with the 11.2 toolchain, macos works fine, but linux gives an error:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$__TtCs12_SwiftObject", referenced from:
      _$S12trolldropapp15TrollControllerCN in TrollController.swift.df35f1f7.o
  "_OBJC_METACLASS_$__TtCs12_SwiftObject", referenced from:
      _$S12trolldropapp15TrollControllerCMm in TrollController.swift.df35f1f7.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

edit: source code https://github.com/XMB5/trolldropapp

kabiroberai commented 6 years ago

Which version of Swift are you using?

XMB5 commented 6 years ago

Swift version 4.2 (swift-4.2-RELEASE) Target: x86_64-unknown-linux-gnu

kabiroberai commented 6 years ago

4.2 requires the iOS 12.0 SDK, which only works on macOS atm. I’ve temporarily rolled back the Swift toolchain available on my website to 4.1.2. Simply follow the instructions on the wiki again to install that version.

XMB5 commented 6 years ago

Thanks! It works now.

(for anyone in the future, download the swift 4.1.2 toolchain at https://github.com/kabiroberai/swift-toolchain-linux/releases/download/v1.0.0/swift-4.1.2-ubuntu16.10.tar.gz)