libiconv not linking to iOS project

28,413

Solution 1

As extra confirmation that the lib is included in your target, select the lib in the file list in the left pane of Xcode (assuming you've added it to your Target / Project, you should see the framework listed under frameworks), and show the Assistant Editor view on the right pane (View -> Assistant Editor -> Show Assistant Editor).

Then, with the relevant lib selected on the left, you will see 'Target Membership' for that lib shown as a list of checkboxes on the right.

You should see App Target Listed, and the checkbox should be checked for that target.

You could try unchecking and rechecking it, to nudge it into your project?

Solution 2

You need add libiconv.dylib via "add framework". SRC is available from this discussion.

Share:
28,413

Related videos on Youtube

sarahhodne
Author by

sarahhodne

Infrastructure Engineer at Circle CI

Updated on July 09, 2022

Comments

  • sarahhodne
    sarahhodne almost 2 years

    I'm trying to compile MailCore into an iOS app I'm making, and the linker keeps complaining that libiconv isn't linked in. At least that's what I think it's complaining about. This is what it spits out:

    Undefined symbols for architecture i386:
      "_iconv", referenced from:
          _mail_iconv in libmailcore.a(charconv.o)
      "_iconv_open", referenced from:
          _charconv in libmailcore.a(charconv.o)
          _charconv_buffer in libmailcore.a(charconv.o)
      "_iconv_close", referenced from:
          _charconv in libmailcore.a(charconv.o)
          _charconv_buffer in libmailcore.a(charconv.o)
    ld: symbol(s) not found for architecture i386
    collect2: ld returned 1 exit status
    

    (This is building for the simulator. Building for my iPhone gives the same error, but s/i386/armv7/).

    I've tried adding libiconv.dylib to "Link Binary with Libraries", but it doesn't change the errors at all.

    Any idea what could be wrong here? I've been trying to Google this error, but I can't find any information about how to link in libiconv. Since it's part of the iOS SDK, you would think I shouldn't need to compile it myself?

    • naz
      naz over 8 years
      libiconv.dylib did it
  • sarahhodne
    sarahhodne over 12 years
    Thanks, that did it! It was in the File Inspector though (Option-Cmd-1 in Xcode 4, or View > Utilities > Show File Inspector).
  • Snips
    Snips over 12 years
    Good to hear. Thanks for letting us know, and accepting the answer.
  • Ganesh
    Ganesh over 9 years
    I have tried the same thing for libjumio library, but no use. Can you please help me how to resolve the issue for the same.