-1

I am trying to migrate my project to swift 3 and I have run into the following problem. I believe it was caused after running pod update. I am using Xcode 8.2.1.

ld: file not found: /Users/tomfox/Library/Developer/Xcode/DerivedData/Flick_Quiz-ergbsdsnlpucndfmjqybgarjwaam/Build/Intermediates/Flick Quiz.build/Debug-iphonesimulator/Flick Quiz Dev.build/Objects-normal/x86_64/FollowingViewController.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am also experiencing another warning, I'm not sure but it may be related to the first error:

Warning: Multiple build commands for output file /Users/tomfox/Library/Developer/Xcode/DerivedData/Flick_Quiz-ergbsdsnlpucndfmjqybgarjwaam/Build/Products/Debug-iphonesimulator/Flick Quiz.app/.gitkeep

Cœur
  • 37,241
  • 25
  • 195
  • 267
Tom Fox
  • 897
  • 3
  • 14
  • 34

2 Answers2

0

From the message it looks like FollowingViewController is somehow not included in the target you are trying to build - I would start with going to that view controller, and seeing if it's included in the target you are building (right panel open, first tab for target membership). if it is included, then start looking to see why it did not compile that file properly. Doing a "Clean Build Directory" is a good idea - hold down Alt while you open the "Product" menu and you should see "Clean" change to "Clean Build Directory".

From the second message, it looks like a file called ".gitkeep" was somehow accidentally included in the target membership? Possibly from multiple cocoa pod repositories. That message is not really an error, but happens when you have two files with the same name that are included in the same target, because when compiling the app Xcode copies files from all different locations and puts them at the top level of the application bundle. Like I said it's not an error exactly, but I would say that text files that aren't really part of your project should generally not be included in the target. If it is a cocoa pod file, it would be in the Pods project... I'd search at the bottom of the file navigator for "gitkeep" and see what comes up.

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
  • I managed to find the .gitkeep file, sorted that warning now. I tried doing the clean build directory but that did not get rid of the Match-O Linker error. – Tom Fox Jan 08 '17 at 21:10
  • The branch I am on was fine until I moved to it recently, could it be a problem with xcode? May it be worth uninstalling and reinstalling Xcode to see if that changes anything? – Tom Fox Jan 08 '17 at 21:22
  • You may as well try re-installing Xcode, but I don't think it would resolve an issue where a .o file is not being generated or found... – Kendall Helmstetter Gelner Jan 09 '17 at 17:33
0

When I had this error there were other errors in the project because of swift3 migration, it seems that fixing the other issues removed the Match-O Linker. I assume this is because the project could not be compiled properly so the derived data was not complete - although I am not sure on this so please tell me if I am wrong.

Tom Fox
  • 897
  • 3
  • 14
  • 34