libiconv conundrum: requires version x.0.0 or late

2019-08-25 06:19发布

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条回答
We Are One
2楼-- · 2019-08-25 07:12

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.)

查看更多
登录 后发表回答