链接器命令失败,退出代码为1(使用-v查看调用)xcode

时间:2015-09-24 16:46:49

标签: objective-c xcode linker

我在xcode中看到了这个错误,但我不知道可能是什么原因。我不知道我做了什么导致这个问题:

localhost:3000
ld: warning: directory not found for option '-L2'
duplicate symbol _OBJC_IVAR_$_JVMenuPopoverViewController._vibrancyEffectView in:
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/MADVenuesTopListAroundViewController.o
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/JVMenuPopoverViewController.o
duplicate symbol _OBJC_IVAR_$_JVMenuPopoverViewController._blurEffectView in:
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/MADVenuesTopListAroundViewController.o
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/JVMenuPopoverViewController.o
duplicate symbol _OBJC_IVAR_$_JVMenuPopoverViewController._vibrancyEffect in:
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/MADVenuesTopListAroundViewController.o
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/JVMenuPopoverViewController.o
duplicate symbol _OBJC_IVAR_$_JVMenuPopoverViewController._doneAnimations in:
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/MADVenuesTopListAroundViewController.o
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/JVMenuPopoverViewController.o
duplicate symbol _OBJC_IVAR_$_JVMenuPopoverViewController._icons in:
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/MADVenuesTopListAroundViewController.o
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/JVMenuPopoverViewController.o
duplicate symbol _OBJC_IVAR_$_JVMenuPopoverViewController._image in:
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/MADVenuesTopListAroundViewController.o
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/JVMenuPopoverViewController.o
duplicate symbol _GMSOrientationMake in:
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/AppDelegate.o
    /Users/DesarrolloOS/Library/Developer/Xcode/DerivedData/aplication-cturpddkzvdycrbrfxglegcvaepl/Build/Intermediates/aplication.build/Debug-iphonesimulator/aplication.build/Objects-normal/i386/MADViewController.o
ld: 16 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:0)

您有16个重复的符号。这些值已包含在JVMenuPopoverViewController.o和MADVenuesTopListAroundViewController.o中。你需要他们只在一个地方。

查看名称,我的猜测是您已将部分或全部实现部分放入JVMenuPopoverViewController.h,然后将该文件导入MADVenuesTopListAroundViewController.m。这样,MADVenuesTopListAroundViewController.o和JVMenuPopoverViewController.o都会以该实现部分结束,因此它会在您的应用中进行两次。

您需要将实现部分移动到JVMenuPopoverViewController.m中。只有接口声明应该在JVMenuPopoverViewController.h中。

如果你无法从那里弄清楚,或者我的猜测是错误的,那么你需要显示JVMenuPopoverViewController.h,JVMenuPopoverViewController.m,MADVenuesTopListAroundViewController.h,MADVenuesTopListAroundViewController.m的代码。