Skip to content
This repository has been archived by the owner on Jan 21, 2019. It is now read-only.

unable to load iconv NIF #1

Open
guobosheng opened this issue Feb 26, 2014 · 2 comments
Open

unable to load iconv NIF #1

guobosheng opened this issue Feb 26, 2014 · 2 comments

Comments

@guobosheng
Copy link

unable to load iconv NIF

@fabiobc
Copy link

fabiobc commented Sep 7, 2014

I had a similar issue trying to compile ejabberd with Erlang R15 on my Mac OS X (10.9.4). There were no errors during the build (I used the homebrew formula). But when I attempted to run ejabberd through the ejabberdctl start command it would start and crash with that error. I checked the iconv.so file that was generated during the build of eiconv using otool -L and it only listed libSystem.B.dylib as a dependency, and not libiconv.2.dylib.
I cloned the eiconv repository and running configure then make yielded the same result. I looked at the p1_yaml project and noticed that the rebar.config file had a linker flag for the libyaml. So I changed this line in the rebar.config file

{port_env, [{"CFLAGS", "-g -O2 -Wall"}]}.

to

{port_env, [{"CFLAGS", "$CFLAGS -g -O2 -Wall"},
        {"LDFLAGS", "$LDFLAGS -liconv"}]}.

and that seems to fix the problem. The iconv.so file that the clang makes now lists libiconv as one of the shared libraries that is used and ejabberd runs normally after replacing the previous version of the iconv.so file. I don't know if the configure script needs any changes as well.

@apcxiii
Copy link

apcxiii commented Jan 30, 2018

Yup, I have the same problem an solved it with:

cp /usr/local/lib/iconv-1.0.6/priv/lib/iconv.so /usr/home/freebsd/staging/atena/lib/iconv-1.0.6/priv/lib/iconv.so

At the elixir release

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

No branches or pull requests

3 participants