chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Incremental compiling


From: felix winkelmann
Subject: Re: [Chicken-users] Incremental compiling
Date: Wed, 4 Feb 2009 20:32:45 +0100

On Wed, Feb 4, 2009 at 2:49 PM, William Ramsay <address@hidden> wrote:
> I put my list of files into a Makefile using the same code you gave below.
> Make runs through each file and compiles it to an object file with no
> problem at all.   However, when I try to link it all together with
> csc -o foo a.o.b.o.c.o
>
> I get all sorts of errors for multiple definitions of  C_toplevel and main.
>
> How do I get past that hurtle?
>

Well, you mustn't forget that my advice is practically *always* incomplete
and omits certain important details... It is for a reason that my academic
record looks so bad.

Of course you have to compile each file as "library units", to avoid exactly
the problem that you've run into: the default compilation mode of chicken
is to create a standalone executable. But we can't just link three standalone
executables into another one (dumb linkers - what's so hard about it?).

Please compile each file with "-unit <unitname>" or use "(declare
(unit <unitname>))"
in the mentioned files. The main program should then use these libraries with

  (declare (uses <unitname1> ...))

Note that the main module is not compiled as a unit.


cheers,
felix




reply via email to

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