| 75 | |
| 76 | |
| 77 | == Incompatible library version: X requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 == #libiconv-version |
| 78 | |
| 79 | You might see this error when running a program, or in the main.log or config.log when a port fails to configure or build: |
| 80 | |
| 81 | {{{ |
| 82 | dyld: Library not loaded: /opt/local/lib/libiconv.2.dylib |
| 83 | Referenced from: /path/to/X |
| 84 | Reason: Incompatible library version: X requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 |
| 85 | }}} |
| 86 | |
| 87 | This usually means libiconv is installed for the wrong architecture(s) and needs to be rebuilt. To rebuild libiconv: |
| 88 | |
| 89 | {{{ |
| 90 | sudo port -n upgrade --force libiconv |
| 91 | }}} |
| 92 | |
| 93 | But if libiconv's architecture was wrong, it's likely other ports have the similar problem. The usual reason for architecture mismatches is that you migrated from Leopard or earlier to Snow Leopard or later and did not follow the [wiki:Migration migration instructions]. |
| 94 | |
| 95 | The error message is confusing. What OS X should be saying is: "The program or library X is linked with /opt/local/lib/libiconv.2.dylib and requires version 8.0.0 of that library. /opt/local/lib/libiconv.2.dylib is at least version 8.0.0, but it's built for the wrong architecture, so I'm going to look around for another libiconv.2.dylib. Ok, I found /usr/lib/libiconv.2.dylib and it's built for the right architectures, so I'll use that instead. Wait, /usr/lib/libiconv.2.dylib is only version 7.0.0. That's too old for X. I'll display an error message that the version is too old." |
| 96 | |
| 97 | Another possible culprit is that you have DYLD_LIBRARY_PATH set in your environment; if so, try unsetting it. |
| 98 | |