Re: [solved] Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-11-01 Thread Chris Eidhof
I can confirm that, if you follow the steps on the wiki, you'll end up with a working Mac application. Excellent work John, thanks very much! -chris On 30 okt 2009, at 00:53, John Velman wrote: It's taken 21 days with interruptions, but I finally posted a tutorial with details of what I

Re: [solved] Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-29 Thread John Velman
It's taken 21 days with interruptions, but I finally posted a tutorial with details of what I did on the Haskel Wiki. Category:Tutorials, title: Using Haskell in an Xcode Cocoa project Hope it's clear. Please send comments and suggestions. John V. On Thu, Oct 08, 2009 at 10:34:07AM +0200,

Re: [solved] Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-08 Thread Wouter Swierstra
On 7 Oct 2009, at 23:39, John Velman wrote: For anyone following this: The XCode ld script is complex, and has mac specific defaults early in the search path specification, and I probably don't want to change these. A library in a default path is the wrong libgmp.[dylib | a]. Is there

Re: [solved] Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-08 Thread John Velman
On Thu, Oct 08, 2009 at 10:34:07AM +0200, Wouter Swierstra wrote: On 7 Oct 2009, at 23:39, John Velman wrote: For anyone following this: The XCode ld script is complex, and has mac specific defaults early in the search path specification, and I probably don't want to change these. A

Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-07 Thread John Velman
This is probably an Xcode problem now, rather than a strictly Haskell problem. There are a bunch of libgmp.a and libgmp.dylib files in existence on this computer, some in /usr/local/lib, or linked from there. I've got my errors down to references in libgmp, whether or not I try to include

[solved] Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-07 Thread John Velman
For anyone following this: The XCode ld script is complex, and has mac specific defaults early in the search path specification, and I probably don't want to change these. A library in a default path is the wrong libgmp.[dylib | a]. My solution: do a ln -s libgmp.a lib-h-gmp.a in the

[Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-06 Thread John Velman
I think if I knew which libraries to add to the gcc link, I could make this work, but can't seem to find out from the documentation. Here are more specifics: I'd like to build a Cocoa program on OS X with the Aqua user interface using Xcode, but using a Haskell module with functions accessed

Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-06 Thread Thomas DuBuisson
Generally you should be able to tell which library you're missing based on the names of the undefined symbols. Have you link in... libgmp.a? libm.a? libc.a? What are the missing symbols? Thomas On Tue, Oct 6, 2009 at 9:44 AM, John Velman vel...@cox.net wrote: I think if I knew which libraries

Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-06 Thread John Velman
On Tue, Oct 06, 2009 at 09:48:44AM -0700, Thomas DuBuisson wrote: Thanks, Thomas. Linking in only libffi.a, libgmp.a, I get (for example, there are many more) missing: _newCAF _base_GHCziBase_plusInt_closure _base_GHCziList_zzipWith_info _base_GHCziList_lvl5_closure by also linking

Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-06 Thread Thomas DuBuisson
You are missind libHSbase. Try, for example: locate libHSbase-3.0.1.0.a and link that in. Thomas On Tue, Oct 6, 2009 at 11:51 AM, John Velman vel...@cox.net wrote: On Tue, Oct 06, 2009 at 09:48:44AM -0700, Thomas DuBuisson wrote: Thanks, Thomas. Linking in only libffi.a, libgmp.a, I

Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-06 Thread Gregory Collins
John Velman vel...@cox.net writes: On Tue, Oct 06, 2009 at 09:48:44AM -0700, Thomas DuBuisson wrote: Thanks, Thomas. Linking in only libffi.a, libgmp.a, I get (for example, there are many more) missing: _newCAF _base_GHCziBase_plusInt_closure _base_GHCziList_zzipWith_info

Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-06 Thread John Velman
Thanks, Gregory. I did something like that. In particular, I did find . -name lib*.a | xargs nm ~/develop/haskellLibInfo/libInfo Then I used the output from the build results file to look for stuff in the libInfo file (using mac_vim). In this way I cut the number of undefined references down

Re: [Haskell-cafe] Calling Haskell from C, Linking with gcc?

2009-10-06 Thread Brandon S. Allbery KF8NH
On Oct 6, 2009, at 19:20 , John Velman wrote: HSghc-prim-0.1.0.0.o, HSinteger-0.1.0.1.o, libffi.a, libgmp.a, libHSbase-3.0.3.1.a, libHSbase-3.0.3.1_p.a, libHSbase-4.1.0.0.a, libHSghc-prim-0.1.0.0_p.a, libHSrts.a Note that library order matters; libgmp.a should probably be