0

I need some help please. I can't seem to figure out how to fix this clang error in Xcode 10.0, Swift 4 (MacOs Cocoa):

linker command failed with exit code 1 (use -v to see invocation)

Here is a picture of the build log:

enter image description here

Does anyone know how to fix this? Thank you.

P.S. Please note that I am not using Cocoa Pods, but my app does use URL

techyCode1
  • 49
  • 5
  • If you want an answer, you need to update your question with more information. Does your project use Cocoapods or any other third-party frameworks? If you press Cmd-9, you can select the build and see the low-level steps Xcode takes to build the project. See the following question: [Xcode - how to see build command and log?](https://stackoverflow.com/questions/30060898/xcode-how-to-see-build-command-and-log/30084344). Update your question with the contents of the build log for the link step that fails. – Swift Dev Journal Sep 12 '20 at 19:12
  • Ok I will, thanks. – techyCode1 Sep 12 '20 at 20:49
  • Just added more information. Hope it’s useful. – techyCode1 Sep 12 '20 at 22:29
  • The link error says you have an empty object file, `view2.0`. That error implies there was a problem compiling a file `view2.swift`. Update your question with the build log for the build step that compiles `view2.swift`. – Swift Dev Journal Sep 12 '20 at 23:41
  • Ok, I updated my question again. I hope it's more helpful this time :) – techyCode1 Sep 13 '20 at 03:49
  • You need to show the build log for compiling the file `view2.swift`. All you did was show a longer version of the link step. The linker error is saying you have an empty object file. The length=0 part of the error message is telling you the object file is empty. You need to show the step where the compiler compiles the Swift file to an object file. – Swift Dev Journal Sep 13 '20 at 17:45
  • Ok, I think I understand. Sorry about that – techyCode1 Sep 13 '20 at 19:59
  • One problem: I don’t see the Compile Step – techyCode1 Sep 13 '20 at 20:12
  • Wait! Nvm, It worked! All I did was save the "view2.swift" file with CMD+S. – techyCode1 Sep 13 '20 at 20:30
  • Thank you for your prompt reply to my question. It really helped. :) – techyCode1 Sep 13 '20 at 20:35

0 Answers0