Andrew Butterfield wrote:
> 
> $ ghc --make -package wx HelloWorld.hs 
> [2 of 2] Compiling Main             ( HelloWorld.hs, HelloWorld.o )
> Linking HelloWorld ...
> ld: warning: in /opt/local/lib/libwx_osx_cocoau_xrc-2.9.dylib, file was built 
> for unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libwx_osx_cocoau_webview-2.9.dylib, file was 
> built for unsupported file format which is not the architecture being linked 
> (i386)
>  [..]
> Undefined symbols:
>   "_iconv_open", referenced from:
>       _hs_iconv_open in libHSbase-4.3.1.0.a(iconv.o)
>      (maybe you meant: _hs_iconv_open)
>   "_locale_charset", referenced from:
>       _localeEncoding in libHSbase-4.3.1.0.a(PrelIOUtils.o)
>   "_iconv", referenced from:
>       _hs_iconv in libHSbase-4.3.1.0.a(iconv.o)
>      (maybe you meant: _hs_iconv_open, _hs_iconv , _hs_iconv_close )
>   "_iconv_close", referenced from:
>       _hs_iconv_close in libHSbase-4.3.1.0.a(iconv.o)
>      (maybe you meant: _hs_iconv_close)
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> 
> [~/Documents/wxOnMacOSX]
> $

Yay, I know what's going on!

* The first error messages indicate that GHC complains about your 
wxWidgets installation being 32bit. This means that you have a 64bit 
GHC. The solution is to install the wxWidgets library with the 
+universal flag, i.e.

     sudo port install wxWidgets-devel +universal

It might be that you have to do the same with the dependencies of the 
wxWidgets-devel port. You can set the +universal flag globally in

     /opt/local/etc/macports/variants.conf

* The undefined symbols are due to two different libiconv, one provided 
by OS X and one provided by Macports. The solution is to tell GHC to 
prefer the former

     ghc --make -package wx HelloWorld.hs -L/usr/lib


Both these issues can be avoided by using homebrew. Whether this merely 
trades them for other issues is another question, of course...


Concerning the EnableGUI thing, it will be obsolete very soon. I have 
submitted a patch to Jeremy who will upload a new version to hackage 
once he has tested all platforms.


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to