linker command failed with exit code 1 (use -v to see invocation) 变量重名

时间:2020-12-13 09:43:35

有时候,xcode报错看不到,点最后一个按钮,类似气泡的就能看到

报错信息:

duplicate symbol _imgNummmm in:
    /Users/mianmian/Library/Developer/Xcode/DerivedData/Hopa-eoovygqexylwftalhofmgorgetlw/Build/Intermediates.noindex/Hopa.build/Debug-iphoneos/Hopa.build/Objects-normal/arm64/HPEmojiCollectionViewCell.o
    /Users/mianmian/Library/Developer/Xcode/DerivedData/Hopa-eoovygqexylwftalhofmgorgetlw/Build/Intermediates.noindex/Hopa.build/Debug-iphoneos/Hopa.build/Objects-normal/arm64/LCInputToolBar.o
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

imgNummmm这个变量重名了

用static修饰就好了