[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] undefined reference to `C_numbers_toplevel'

From: Peter Bex
Subject: Re: [Chicken-users] undefined reference to `C_numbers_toplevel'
Date: Fri, 23 Nov 2012 22:59:37 +0100
User-agent: Mutt/

On Fri, Nov 23, 2012 at 12:27:29PM -0800, Miguel Fernandez wrote:
> Hey everyone,

Hello Miguel!

> I'm just starting out in Scheme, and trying to compile a small snippet that 
> uses complex numbers. The code is as follows:
>     (use numbers)
>     (begin
>       (display 3+3i)
>       (newline)
>     )
> I installed the `numbers` egg with `chicken-install`, load it with `use`, and 
> when I run it (as a script) through the interpreter `csi` it works perfectly. 
> Unfortunately, when I try to compile it with:
>     csc -uses numbers main.scm

Hm, I think "uses" is for old-style "units".  Normally you'd just compile
the program and it should work.  Because numbers has special syntax that
extends the basic reader you'll need to use "csc -X numbers-syntax main.scm"

See also the docs:

> I get the following error:
>     main.o: In function `C_toplevel':
>     main.c:(.text+0x1c2): undefined reference to `C_numbers_toplevel'
>     collect2: ld returned 1 exit status

I'm not sure why that happens.  I guess it's caused by the "uses" switch
which assumes you're statically linking?

Hope this helps,
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

reply via email to

[Prev in Thread] Current Thread [Next in Thread]