Skip to content

Using Ruby module: dyld: lazy symbol binding failed: Symbol not found: _libiconv_open #12

Description

@priancho

System environment:

OS: OS X Lioon 10.7.5
RVM: rvm 1.22.18
Ruby: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64_darwin11]


I tried to use ruby extension of SimString.
It was successfully compiled, but when I ran the sample_unicode.rb (sample.rb runs without any problem) faced the following error messages.

$ ruby sample_unicode.rb

dyld: lazy symbol binding failed: Symbol not found: _libiconv_open
Referenced from: /Users/priancho/work/PubDictionaries/simstring-1.0/swig/ruby/simstring.bundle
Expected in: flat namespace

dyld: Symbol not found: _libiconv_open
Referenced from: /Users/priancho/work/PubDictionaries/simstring-1.0/swig/ruby/simstring.bundle
Expected in: flat namespace

Trace/BPT trap: 5

It seems that the problem comes from two libiconv libraries: one is OS X default library in /usr/lib and the other one is installed by MacPorts in /opt/local/lib.

Googling didn't give much information, but finally one of them worked for me.

In the simstring-1.0/swig/ruby/extconf.rb, put the following line before the create_makefile command as follows.

require 'mkmf'
$CFLAGS='-I../../include'
$LDFLAGS="-lstdc++"

have_library("iconv", "libiconv_open")
create_makefile('simstring')

Then, sample_unicode.rb started work fine.

However, I could not figure out why this one line fixes the problem :-(

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions