Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Link error with libiconv on MacOS #74

Closed
r0ml opened this issue Mar 21, 2014 · 2 comments
Closed

Link error with libiconv on MacOS #74

r0ml opened this issue Mar 21, 2014 · 2 comments

Comments

@r0ml
Copy link

r0ml commented Mar 21, 2014

Compiling a small program results in this error message:

[1 of 2] Compiling TestHelper? ( testsuite/tests/TestHelper.hs, dist/build/test-played-tracks/test-played-tracks-tmp/TestHelper.o ) [2 of 2] Compiling Main ( testsuite/tests/TestPlayedTracks.hs, dist/build/test-played-tracks/test-played-tracks-tmp/Main.o ) Linking dist/build/test-played-tracks/test-played-tracks ... Undefined symbols for architecture x86_64:

"_iconv", referenced from:

_hs_iconv in libHSbase-4.5.1.0.a(iconv.o)

(maybe you meant: _base_GHCziIOziEncodingziIconv_iconvEncoding8_closure, _base_GHCziIOziEncodingziIconv_iconvEncoding5_info , _base_GHCziIOziEncodingziIconv_iconvEncoding10_closure , _base_GHCziIOziEncodingziIconv_iconvEncodingzuloc1_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding7_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding6_info , _hs_iconv_open , _base_GHCziIOziEncodingziIconv_iconvEncoding6_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding7_info , _base_GHCziIOziEncodingziIconv_iconvEncoding5_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding8_info , _base_GHCziIOziEncodingziIconv_iconvEncoding4_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding9_info , _base_GHCziIOziEncodingziIconv_iconvEncoding3_closure , _base_GHCziIOziEncodingziIconv_iconvEncoding2_info , _base_GHCziIOziEncodingziIconv_iconvEncoding2_closure , _hs_iconv , _base_GHCziIOziEncodingziIconv_iconvEncoding3_info , _base_GHCziIOziEncodingziIconv_iconvEncoding10_info , _base_GHCziIOziEncodingziIconv_iconvEncodingzuloc_closure , _base_GHCziIOziEncodingziIconv_iconvEncodingzuloc_info , _base_GHCziIOziEncodingziIconv_iconvEncoding9_closure , _hs_iconv_close , _base_GHCziIOziEncodingziIconv_iconvEncodingzuloc1_info )

"_iconv_close", referenced from:

_hs_iconv_close in libHSbase-4.5.1.0.a(iconv.o)

(maybe you meant: _hs_iconv_close)

"_iconv_open", referenced from:

_hs_iconv_open in libHSbase-4.5.1.0.a(iconv.o)

(maybe you meant: _hs_iconv_open)

"_locale_charset", referenced from:

_localeEncoding in libHSbase-4.5.1.0.a(PrelIOUtils.o)

ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status

It seems that ghc is looking in the wrong directory for libiconv. By specifying --extra-lib-dirs=/usr/lib compilation works.

The MacOS Version is 10.8.2

@r0ml r0ml added this to the Next Release milestone Mar 21, 2014
@r0ml
Copy link
Author

r0ml commented Mar 21, 2014

@mzero
Copy link
Member

mzero commented May 28, 2014

This bug arises when people install versions of system libs (like iconv) from brew. GHC has long since ensured they use the right version... and there is little the platform can do beyond that.

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

No branches or pull requests

2 participants