-4

When I build I am getting

 Ld /Users/Shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Products/Debug-iphoneos/appname.app/appname normal armv7
    cd "/Users/shouri/Desktop/appname Project/appname"
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Products/Debug-iphoneos -F/Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Products/Debug-iphoneos -filelist /Users/shouri/Library/Developer/Xcode/DerivedDataappname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/appname.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.1 -framework CoreData -framework AVFoundation -framework MobileCoreServices -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Products/Debug-iphoneos/appname.app/appname

duplicate symbol _OBJC_IVAR_$_HatsCamera.cameraSwitch in:
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/HatsCamera.o
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/BottomsCamera.o
duplicate symbol _OBJC_IVAR_$_HatsCamera.FrontCamera in:
    /Users/shouri/Library/Developer/Xcode/DerivedData/appaname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/HatsCamera.o
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/BottomsCamera.o
duplicate symbol _OBJC_IVAR_$_HatsCamera.captureImage in:
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/HatsCamera.o
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/BottomsCamera.o
duplicate symbol _OBJC_IVAR_$_HatsCamera.stillImageOutput in:
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/HatsCamera.o
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/BottomsCamera.o
duplicate symbol _OBJC_IVAR_$_HatsCamera.haveImage in:
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/HatsCamera.o
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/BottomsCamera.o
duplicate symbol _OBJC_IVAR_$_HatsCamera.imagePreview in:
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/HatsCamera.o
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/BottomsCamera.o
duplicate symbol _OBJC_CLASS_$_HatsCamera in:
    /Users/shouri/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/HatsCamera.o
    /Users/shourio/Library/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/BottomsCamera.o
duplicate symbol _OBJC_METACLASS_$_HatsCamera in:
    /Users/shouriLibrary/Developer/Xcode/DerivedData/appname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/HatsCamera.o
    /Users/shouri/Library/Developer/Xcode/DerivedDataappname-defwdplzurhoraeqlkbatxopkutg/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/BottomsCamera.o
ld: 8 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How Can I get rid of this problem,Since I have looked through the internet for weeks and can't find the best answer that suits my problem..

Simon
  • 25,468
  • 44
  • 152
  • 266
Shouri
  • 39
  • 6
  • Have you tried everything - cleaning the project, the project folder, running the project on both device and simulator? – Sergey Grischyov Aug 20 '13 at 11:55
  • 1
    possible duplicate question of http://stackoverflow.com/questions/6429494/undefined-symbols-for-architecture-armv7 ,http://stackoverflow.com/questions/12200238/ios-2-duplicate-symbols-for-architecture-armv7 – Toseef Khilji Aug 20 '13 at 11:59
  • Post the sources for `HatsCamera.m` and `BottomCamera.m` – guitarflow Aug 20 '13 at 12:03

2 Answers2

1
duplicate symbol _OBJC_IVAR_$_HatsCamera.cameraSwitch in:
/Users/shouri/Library/.../HatsCamera.o
/Users/shouri/Library/.../BottomsCamera.o

HatsCamera.cameraSwitch seems to be declared more than once. That's just one of the errors, but the others are of the same kind.

If you have trouble locating the error, post the source code so we can see where the problem is.

guitarflow
  • 2,930
  • 25
  • 38
0
ld: 8 duplicate symbols for architecture armv7

Is the reason for your error. It seems somewhere in your project you have 2 same files, and that's causing the error.

Take a thorough look at HatsCamera.m and BottomsCamera.m files in your project and your project folder. Try completely deleting them and readding them.

Sergey Grischyov
  • 11,995
  • 20
  • 81
  • 120
  • You mean `HatsCamera.m` ... and `BottomsCamero.m`. Also re-adding them won't help; they need fixing. – trojanfoe Aug 20 '13 at 11:57
  • @trojanfoe what's _fixing_ for you, then? – Sergey Grischyov Aug 20 '13 at 11:58
  • @trojanfoe How about you take them from a reliable source - like a compiled library (where the user might have taken them from) so you won't need any _editing_? – Sergey Grischyov Aug 20 '13 at 12:00
  • Huh? I don't understand what you're talking about. – trojanfoe Aug 20 '13 at 12:00
  • @trojanfoe I mean that when and if I face such a problem this usually happens with some external 3rd party library I have nothing to do with. Re-adding the source files usually helps. – Sergey Grischyov Aug 20 '13 at 12:02
  • 1
    OK, but who's saying these source files are from an external source? – trojanfoe Aug 20 '13 at 12:03
  • 1
    I don't think you are right with this one: `It seems somewhere in your project you have 2 same files` There are no duplicate files, there are duplicate symbols! In this case e.g. `HatsCamera.cameraSwitch` is defined more than once. Here it's defined in two files, `HatsCamera.m`and `BottomCamera.m`, but this does not mean that these two files are identical. – guitarflow Aug 20 '13 at 12:11
  • @guitarflow sometimes it does, however, because I've had this problem myself a long time ago. And are you trying to say that I can't use the properties with the same name over different classes? – Sergey Grischyov Aug 20 '13 at 12:28
  • 1
    Of course you can. I can't say what his problem is exactly without seeing the source files. However, you said in your answer that the reason for the error is two identical files and this is just not correct. It can be the reason, but it doesn't have to be. That's all I'm saying. – guitarflow Aug 20 '13 at 13:43