chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Compiling multiple modules into a single executable


From: Thomas Chust
Subject: Re: [Chicken-users] Compiling multiple modules into a single executable
Date: Sun, 16 Oct 2016 23:08:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

On 2016-10-16 22:52, Josh Barrett wrote:
> [...]
> $ csc -c foo.scm bar.scm
> 
> Syntax error (import): cannot import from undefined module
> ---
> As I understand it, this should work, but it obviously doesn't. Does
> anybody know why?
> [...]

Hello,

this cannot work because the compiler cannot find the necessary import
libraries.

Try compiling the two files separately and emitting import libraries
like this:

$ csc -c foo.scm -J
$ csc -c bar.scm -J

You can then link to a main program in a separate step, like this:

$ cat main.scm
(declare (uses bar))
(import bar)
(baz)

$ csc foo.o bar.o main.scm -o foobar

$ ./foobar
quuxbaz

Ciao,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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