3

I am using FastPDFKit in my iPhone app for displaying PDF. When I run the project on simulator, it works fine. However when I run the project on iPhone, it gives me below error.

duplicate symbol _value_map in:
    /Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
duplicate symbol _writeUnicodeToUTF8Buffer in:
    /Users/alkandari/Desktop/iPhone Apps/MyTest002/MyTest002/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit)
ld: 871 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: 871 duplicate symbols for architecture armv7


clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any idea why it is happening like this?


Error comes when I add FastPDFFramework in Configuration in Debug and Release section.

Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276

6 Answers6

5

Here's a solution I found even after messing with the header/framework search paths, rebuilding, etc:

http://support.fastpdfkit.com/discussions/problems/443-i-am-unable-to-link-fastpdfkitembeddedframework

I removed the -all_load linker flag in my project and it compiled successfully. As a warning, make sure removing this flag is appropriate for your project. It was probably placed there for a reason

kevinl
  • 4,194
  • 6
  • 37
  • 55
2

Can you try to clean up the FastPdfKit target and recompile it? It should generate a new framework ex-novo that you then should be able to add to you project, overwriting the one you are using. You can grab the new .embeddedframework in the FastPdfKit project root directory.

These line helped me from the link below.

http://support.fastpdfkit.com/discussions/problems/759-duplicate-symbols-for-architecture-armv7

Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
2

there are another reason this error often happens is accidentally importing the .m file instead of the .h.

it's happened to me :)

link : https://stackoverflow.com/questions/12279622/duplicate-symbols-for-architecture-i386-clang

Community
  • 1
  • 1
AITAALI_ABDERRAHMANE
  • 2,499
  • 1
  • 26
  • 31
1

You have too many #include or #import directives in header files for the same things. Move to using @class in headers and only import/include in your .m files.

In all you just need to review where these are and reassess them.

uchuugaka
  • 12,679
  • 6
  • 37
  • 55
  • I don't have many include files. I just have `#import ` in view controller... – Fahim Parkar Mar 17 '13 at 13:01
  • and if I have too many include why problem is not with simulator? why with iphone only? – Fahim Parkar Mar 17 '13 at 13:12
  • Did you move anything ? So what this says to me is that something has been built already and is being rebuilt ( failing ). This something seems to be class extension. But googling for you I can see this on fastpdfkit support forum. http://support.fastpdfkit.com/discussions/problems/759-duplicate-symbols-for-architecture-armv7 – uchuugaka Mar 17 '13 at 15:21
0

I add my solution, as if you follow the readme, it will ask you to do:

Inherit the project options: select the Project an from info tab and configurations line choose **FastPdfKitFramework** from the drop down list;

I replace the FastPdfKitFramework target to None and now it work great.

As it is on the readme file, I never add .a in my project so download the recompile one don't help me as I do not want to restart all integration. I hope it can be helpful for someone.

Dam
  • 579
  • 6
  • 22
-2

I tries removing -all_loads linker flag, and it worked for me without any problem in the project.

Robert
  • 5,278
  • 43
  • 65
  • 115
Arun K
  • 868
  • 10
  • 17