2014-10-17 76 views
1

我已經添加了Unrar4iOS框架並獲得了低於鏈接器錯誤。 如何解決這個問題?鏈接器錯誤Unrar4iOS框架

duplicate symbol __Z12CallbackProcjlll in: 
    /Users/dmitryvlasenko/Library/Developer/Xcode/DerivedData/UnrealReader-cpvucqqjfnkeppcasgjdrwasaryu/Build/Intermediates/UnrealReader.build/Debug-iphonesimulator/UnrealReader.build/Objects-normal/i386/Unrar4iOS.o 
    /Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o) 
duplicate symbol _OBJC_IVAR_$_Unrar4iOS.header in: 
    /Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o) 
duplicate symbol _OBJC_IVAR_$_Unrar4iOS._rarFile in: 
    /Users/dmitryvlasenko/Library/Developer/Xcode/DerivedData/UnrealReader-cpvucqqjfnkeppcasgjdrwasaryu/Build/Intermediates/UnrealReader.build/Debug-iphonesimulator/UnrealReader.build/Objects-normal/i386/Unrar4iOS.o 
    /Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(Unrar4iOS.o) 
duplicate symbol _OBJC_IVAR_$_Unrar4iOS.filename in: 
    /Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(RARExtractException.o) 
duplicate symbol _OBJC_EHTYPE_$_RARExtractException in: 
    /Users/dmitryvlasenko/Library/Developer/Xcode/DerivedData/UnrealReader-cpvucqqjfnkeppcasgjdrwasaryu/Build/Intermediates/UnrealReader.build/Debug-iphonesimulator/UnrealReader.build/Objects-normal/i386/RARExtractException.o 
    /Users/dmitryvlasenko/Desktop/UnrealReader/Unrar4iOS.framework/Unrar4iOS(RARExtractException.o) 
ld: 12 duplicate symbols for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

回答

0

該錯誤表明Unrar4iOS既在Unrar4iOS.a中定義,也作爲項目中的單個文件定義。 因此,請前往:

TargetSettings-> Build Phases->與庫鏈接二進制文件並刪除Unrar4iOS。

0

看來你已經添加了相同的庫兩次這就是爲什麼它說:「重複的符號__Z12CallbackProcjlll」

0

的的unrar庫是用C++編寫。如果您的項目中沒有任何.mm文件,那麼Xcode不會鏈接到C++標準庫,並且所有對C++的引用都無法鏈接。