今天开发项目是, 遇到了这样一个问题(同事发给我的项目,在他的机器上可以跑,到我这就报错了)。
duplicate symbol _flag in:
/Users/apple/Library/Developer/Xcode/DerivedData/bluetoothPhone-fspknidhnizzjygmuqngfcklvnic/Build/Intermediates/bluetoothPhone.build/Debug-iphonesimulator/bluetoothPhone.build/Objects-normal/i386/DialVC.o
/Users/apple/Library/Developer/Xcode/DerivedData/bluetoothPhone-fspknidhnizzjygmuqngfcklvnic/Build/Intermediates/bluetoothPhone.build/Debug-iphonesimulator/bluetoothPhone.build/Objects-normal/i386/PersonalList.o
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
分析一下, 如图。
可以看出, 错误类型是 duplicate(重复) 错误标识是 _flag 错误位置在 DialVC 和 PersonalList中
于是, 搜索一下, flag。发现...
只要换掉其中一个flag就可以了。
下面的是我的报错:
duplicate symbol __notificationCount in:
/Users/Taylor/Library/Developer/Xcode/DerivedData/OMyCar-fjronizlodzryagubmjxtxismtch/Build/Intermediates/OMyCar.build/Debug-iphonesimulator/OMyCar.build/Objects-normal/i386/MagessCenterController.o
/Users/Taylor/Library/Developer/Xcode/DerivedData/OMyCar-fjronizlodzryagubmjxtxismtch/Build/Intermediates/OMyCar.build/Debug-iphonesi