0

linker command failed with exit code 1 (use -v to see invocation) duplicate symbols for architecture x86_64

I don't know why I got that error even _dragView is not found in my project. I got that error when I used https://github.com/myang-git/iOS-Image-Crop-View in my project. Below image is error details.

enter image description here

PPShein
  • 13,309
  • 42
  • 142
  • 227
  • Are you including "ImageCropView.h" anywhere? It seems you should include "ViewController.h" instead – Margaret Bloom Mar 03 '16 at 08:18
  • @MargaretBloom I'm including "ImageCropView.h" because that's what I need to crop image. – PPShein Mar 03 '16 at 08:22
  • Ok, Do you have the file *ViewController.m* in your project? If so, remove it (Along with *ViewController.h*). It should just be a sample. – Margaret Bloom Mar 03 '16 at 08:25
  • @MargaretBloom same error even removed. – PPShein Mar 03 '16 at 08:33
  • The error you posted explicitly show a duplicate symbol between *ImageCropView.m* and *ViewController.m*. If you removed *ViewController.m*, the error cannot be the same. Anyway I think you only need the files: *ImageCropView.h, ImageCropView.m* and the dir *FXBlurView*. Try cleaning your project. – Margaret Bloom Mar 03 '16 at 08:39
  • @MargaretBloom I've already added those files into my projects. All are same error output. – PPShein Mar 03 '16 at 08:42
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/105229/discussion-between-margaret-bloom-and-ppshein). – Margaret Bloom Mar 03 '16 at 08:42
  • Can you check which are the files where you are using ImageCropView. Also have you modified ImageCropView to include something ? – aman.sood Mar 03 '16 at 08:43
  • I didn't modify anything. Just added ImageCropView.h & .m and FXBlurView.h & .m into my projects. – PPShein Mar 03 '16 at 08:51

2 Answers2

1

Try to comment out UIView* dragView;in file ImageCropView.h and check.

As such there is no use of dragView in ImageCropView anywhere and at my end sample code still works. Developer mush have forgotten to remove it.

Which I am assume somewhere in your code duplication is happening due to dragView property. Might be in xib or storyboard IBOutlet.

aman.sood
  • 872
  • 7
  • 19
0

I have recently face the same issue. I know ppshein got the answer but to help someone else who may suffer from the same issue I was in.
According to my application flow I am using printer related third party class to print. To use that I have created object of that class in both of my files ImagePrintViewController and PrintResultViewController separately and passed required data to it.

In my scenario I am getting same error with variable name like _printerSetup in two of my files/Library/Developer/Xcode/DerivedData/../x86_64/ImagePrintViewController.o and /Library/Developer/Xcode/DerivedData/../x86_64/PrintResultViewController.o.
I have search in both of my file for the above variable name. But I couldn't find that.

After searching long on this I got a idea to delete reference of my second file i.e. BRPrintResultViewController.h and BRPrintResultViewController.m after merging code in my first file.

With this I found my solution and my code runs fine after this.

Er. Vihar
  • 1,495
  • 1
  • 15
  • 29