Pamelloes
Pamelloes

Reputation: 700

Linking libiconv on ios

I am trying to use the objective-git library for an ios application I am in the proccess of developing. I am able to get the library to compile, link, and run perfectly fine in the simulator. However, when I try to run the application on an actual iPad, I get the followign error:

Undefined symbols for architecture armv7s:
  "_libiconv", referenced from:
      _git_path_iconv in libObjectiveGit-iOS.a(path.c.o)
  "_libiconv_close", referenced from:
      _git_path_iconv_clear in libObjectiveGit-iOS.a(path.c.o)
  "_libiconv_open", referenced from:
      _git_path_iconv_init_precompose in libObjectiveGit-iOS.a(path.c.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I believe the issue is that I am compiling the libgit2 library with a different version of iconv then the one included with ios. However, I have messed with the build script in an attempt to force it to link with the ios version, but the error persists. How should I go about properly linking the iconv library so that I can run the application on an actual device?

Upvotes: 1

Views: 1305

Answers (1)

Mert Buran
Mert Buran

Reputation: 3017

You need to add libiconv.tbd to 'Link Binary With Libraries' section in Build Phases.

Note: I know ObjectiveGit fixed this issue but maybe that helps to others those who are trying to use iconv in their projects.

Upvotes: 2

Related Questions