Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
priancho opened this issue Oct 8, 2013 · 0 comments

Comments

@priancho
Copy link

priancho commented Oct 8, 2013

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 :-(

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

No branches or pull requests

2 participants