5

I was using Xcode 6.2 to compile some swift code for an extension target. I kept getting errors similar to:

Undefined symbols for architecture x86_64:
  "__TFSSCfMSSFT21_builtinStringLiteralBp8byteSizeBw7isASCIIBi1__SS", referenced from:
      __TFC23Hall_WatchKit_Extension16GlanceControllercfMS0_FT_S0_ in GlanceController.o

If I declared some properties it compiled fine, but as soon as I tried to use a string literal I begin getting these errors, so even code as simple as this would cause errors:

class GlanceController: WKInterfaceController {
    var service = "somestring"
}

I updated to XCode 6.3 and now, even in a completely empty implementation I get some errors like this:

Undefined symbols for architecture x86_64:
  "__TFSsoi1aUSs17_RawOptionSetType_USs21BitwiseOperationsTypeSs9Equatable__FTQ_Q__Q_", referenced from:
      __TTWVSC26NSKeyValueObservingOptionsSs21BitwiseOperationsType10FoundationFS0_oi1aUS0___fMQPS0_FTS2_S2__S2_ in GlanceController.o

I've tried all of the recommendations in this thread: Swift beta 6 - Confusing linker error message but nothing helped.

Community
  • 1
  • 1
lramirez135
  • 2,872
  • 3
  • 18
  • 18

2 Answers2

1

Check if the "Target Membership" of your files are appropriate.

Saqib Omer
  • 5,387
  • 7
  • 50
  • 71
  • 1
    This is happening to me even if I create a brand new Swift project and try to run it without even writing any new code in it. – lramirez135 Feb 17 '15 at 22:08
  • I recommend you to download Xcode 6.1.1 latest build. I guess you have downloaded Xcode 6.3 beta version. Also update your OS to Yosemite if you have not already. – Saqib Omer Feb 18 '15 at 04:59
0

I found clearing Xcode's DerivedData cache fixed this issue for me (despite Product > Clean not helping).

After quitting Xcode, navigate to ~/Library/Developer/Xcode/DerivedData and delete the cache folder for your project. You can even delete the entire DerivedData folder, it will be rebuilt for each project when you reopen them.

Reopen Xcode, wait for it to reindex files to its heart's content, then build.

cortices
  • 373
  • 2
  • 15
  • Did this help even with your newly created project you were having this issue with? I'm seeing the same thing, even after clearing the entire folder out. – lramirez135 Feb 26 '15 at 00:37
  • Yes. It sounds like my issue is quite possibly caused by something else but manifesting the same errors. – cortices Feb 26 '15 at 02:19