libiconv conundrum: requires version x.0.0 or later but libiconv.2.dylib provides version y.0.0

最后都变了- 提交于 2019-12-11 19:19:05

问题


I am stuck in a libiconv problem.

Environment: Mac OSX Lion / MacBook air

Issue: I tried to install a php extention for international management (intl). During the process, something got wrong. I had to reinstall MacOSX Lion from the utility of the computer.

Now and then, I get the following error when I do almost any command (php -v , or make !!):

    dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib
  Referenced from: /opt/local/bin/gawk
  Reason: Incompatible library version: gawk requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0

(this is an example for gawk, same happens with php or some other commands)

I tried to reinstall Macosx lion again, but I got the same output.

I am not the kind to be scared for so few, so I wanted to recompile libiconv from source and be done with it. installed Xcode (for gcc,..) downloaded the .tar.gz. However, guess what... gawk needs version 8.0.0, and the terminal insults me once again and refuses to create the makefile.

So to sum up: I need libiconv in order to recompile libiconv... That's where I definitely get stuck.

The only solution I can think at this point would be to get a compiled libiconv that would get me out of this mess. Other solution is to turn definitely to linux :) but that would waste the macbook air

Any help greatly appreciated, I have been struggling for a day now ! Many thanks in advance;)

J

NB: I have tried to consider some other stuff about libiconv I could find on stackoverflow and other forums, but it didn't help...


EDIT

Hi again,

I will answer temporarily (if no better answers pops up). Indeed, I could come around only by asking a friend having the exact same mac to give me the compiled version of the library.

To bad there is no official repository for these compiled libraries, as I have absolutely no idea on how I would have done without it.

If you have better suggestions, do not hesitate. I wait before closing the subject, as I do not consider it properly solved. Also, once this done, I get the same pb for libncurses.5.dylib ...

J


回答1:


This looks like macports. Try

port rev-upgrade

If that does not help:

port -f uninstall iconv
port -f uninstall inactive
port selfupdate
port install iconv
port upgrade outdated
port rev-upgrade

Prefix every command with sudo, if you need to. (Or just get a root shell by typing sudo bash, and then the commands above.)



来源:https://stackoverflow.com/questions/18011995/libiconv-conundrum-requires-version-x-0-0-or-later-but-libiconv-2-dylib-provide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!