1

I have added Unrar4iOS framework and getting below linker error. How to fix this?

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)
Pankaj Wadhwa
  • 3,073
  • 3
  • 28
  • 37
DimonDeveloper
  • 137
  • 1
  • 13

4 Answers4

0

The error indicates to you that Unrar4iOS is both defined in Unrar4iOS.a and as individual file in your project. So go to:

TargetSettings->Build Phases->Link Binary with Libraries and remove the Unrar4iOS.

euthimis87
  • 1,134
  • 1
  • 11
  • 18
0

Seems you have added the same library twice thats why it says "duplicate symbol __Z12CallbackProcjlll "

Pankaj Wadhwa
  • 3,073
  • 3
  • 28
  • 37
0

The Unrar library is written in C++. If you don't have any .mm files in your project, then Xcode doesn't link against the C++ standard library, and all the references to C++ fail to link.

DimonDeveloper
  • 137
  • 1
  • 13
0

Here is a compiled test well framework: Unrar4iOS.framework

ZYiOS
  • 5,204
  • 3
  • 39
  • 45