[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Problems with compilation units and modules
From: |
Felix |
Subject: |
Re: [Chicken-users] Problems with compilation units and modules |
Date: |
Mon, 21 May 2012 14:10:57 +0200 (CEST) |
From: megane <address@hidden>
Subject: [Chicken-users] Problems with compilation units and modules
Date: Mon, 21 May 2012 12:24:19 +0300
> Hello,
>
> I'm trying to define a module in a separate compilation.
>
> Here's a simple example that I can't get to compile:
>
>
> File: src/myutil.scm
> -----
>
> (module myutil
> *
> (import chicken scheme)
>
> (define (foo)
> (print "myutil foo")))
>
> (define (bar) (print "myutil bar"))
>
>
> File: src/main.scm
> -----
>
> ;; This works
> (bar)
>
> ;; This doesn't
> (import myutil)
> (foo)
>
> ;; csc -unit myutil src/myutil.scm -c
> ;; csc -uses myutil src/main.scm src/myutil.o
>
The second compile doesn't have any syntactic information to resolve
the module. If you want to compile the module separately, try the
"-J" (or "-j") option:
csc -unit myutil src/myutil.scm -c -J
This will generate an "import library" containing everything needed
to make "import" work.
cheers,
felix