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

John Velman velman at cox.net
Wed Oct 7 13:38:53 EDT 2009


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 libgmp.a in the project.

Whenever I try to add libgmp.a, or libgmp.dylib to my project, I get the
error message:

----------
ld warning: 
 in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libgmp.dylib, 
 file is not of required architecture
---------

followed by a list of undefined symbols, all of which (well, all I've
checked!) are defined in the Haskell Platform version of libgmp.a

I'm sure there must be a way around this in the Xcode IDE, but haven't
found it.  I'll take the question to the Xcode mailing list.

Thanks to all for help on this.  I'll let you know how it works out!

Best,

John Velman



On Tue, Oct 06, 2009 at 07:56:07PM -0400, Brandon S. Allbery KF8NH wrote:
> 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 last on the 
> command line.
>
> -- 
> brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
> system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
> electrical and computer engineering, carnegie mellon university    KF8NH
>
[previous messages snipped to save virtual paper]


More information about the Haskell-Cafe mailing list