Re: [wxhaskell-users] Using wxHaskell on Mac OS x

2012-04-24 Thread Andrew Butterfield

On 23 Apr 2012, at 23:47, Eric Kow wrote:

 I'm a bit confused by this. Isn't /opt/local used by Macports rather than 
 Homebrew?
 also, does non-ghci stuff work?

Apologies - it was MacPorts  - I was getting hopelessly confused at this stage 
..

If I try to compile HelloWorld.hs I get the error below

It seems clear that I need to identify and inform the build process about my 
architecture

However there are no clear instructions on the wiki on how to do this

(PS - I am having equal  difficulties build wxH 0.9 on wxW 2.9.3  on 64bit 
windows - but that's for another email)


$ 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)
ld: warning: in /opt/local/lib/libwx_osx_cocoau_stc-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_richtext-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_ribbon-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_propgrid-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_aui-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_gl-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_html-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_qa-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_adv-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_core-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_baseu_xml-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_baseu_net-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_baseu-2.9.dylib, file was built for 
unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libiconv.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]
$ 


 
 On Monday, 23 April 2012, Andrew Butterfield wrote:
 I've done yet another attempt at installing wxHaskell on Mac OS X (Intel, 
 Snow Leopard)
 following the page at 
 
  http://www.haskell.org/haskellwiki/WxHaskell/MacOS_X
 
 I setup ghc 7.0.4
 I did brew install wxmac --devel
 
 I am then asked to check my path to make sure I am using  my wxWidgets and 
 not the default one
 
 (I had deleted an old reference to wx 2.8 - now my path does not mention 
 wxwidgets at all)
 
 wx2.9.3 was installed by homebrew in /opt/local/ but I had no idea what 
 to put in my path
 (A question to stackoverflow got a completely useless answer)
 
 So I decided to soldier on...
   I did   cabal install wx cabal-macosx   --- waited - all installed just 
 fine - it seemed
 to have picked up all the stuff installed by brew.
 
 I then got the EnableGUI module as described lower down the page
 it compiled fine
 I then edited HelloWord.hs to import it
 ,and then started ghci as recommended
 
 
 -- 
 Eric Kow http://erickow.com
 PGP Key ID: 08AC04F9
 --
 For Developers, A Lot Can Happen In A Second.
 

Re: [wxhaskell-users] Using wxHaskell on Mac OS x

2012-04-24 Thread Heinrich Apfelmus
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


Re: [wxhaskell-users] Using wxHaskell on Mac OS x

2012-04-24 Thread Jeremy O'Donoghue
On 24 April 2012 12:52, Eric Kow eric@gmail.com wrote:


 /me roots for Nix


Which currently doesn't build :-(

See https://github.com/jodonoghue/wxHaskell/issues/4 - I'm working on it,
but will not be able to test the solution as life is too short to create
Yet Another Test Environment - I already test on the following (the top 3
get the most love):

   - Mac OS X Lion (64bit GHC / 64 bit wxWidgets 2.9.3 / wxHaskell 0.90)
   - Windows 7 Enterprise (64bit OS / 32 bit GHC / 32 bit wxWidgets 2.9.3 /
   wxHaskell 0.90) in a VM
   - Debian 6 (32 bit OS / 32 bit GHC / 32 bit wxWidgets 2.9.3 / wxHaskell
   0.90) in a VM
   - FreeBSD (32 bit OS / 32 bit GHC / 32 bit wxWidgets 2.8.12 / wxHaskell
   0.13) in a VM

That's enough for anyone with other things to do, I'm afraid.

Jeremy
--
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


Re: [wxhaskell-users] Using wxHaskell on Mac OS x

2012-04-23 Thread Eric Kow
I'm a bit confused by this. Isn't /opt/local used by Macports rather than
Homebrew?
also, does non-ghci stuff work?

On Monday, 23 April 2012, Andrew Butterfield wrote:

 I've done yet another attempt at installing wxHaskell on Mac OS X (Intel,
 Snow Leopard)
 following the page at

  http://www.haskell.org/haskellwiki/WxHaskell/MacOS_X

 I setup ghc 7.0.4
 I did brew install wxmac --devel

 I am then asked to check my path to make sure I am using  my wxWidgets
 and not the default one

 (I had deleted an old reference to wx 2.8 - now my path does not mention
 wxwidgets at all)

 wx2.9.3 was installed by homebrew in /opt/local/ but I had no idea
 what to put in my path
 (A question to stackoverflow got a completely useless answer)

 So I decided to soldier on...
   I did   cabal install wx cabal-macosx   --- waited - all installed just
 fine - it seemed
 to have picked up all the stuff installed by brew.

 I then got the EnableGUI module as described lower down the page
 it compiled fine
 I then edited HelloWord.hs to import it
 ,and then started ghci as recommended



-- 
Eric Kow http://erickow.com
PGP Key ID: 08AC04F9
--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users