|
From: | Josh Barrett |
Subject: | Re: [Chicken-users] Compiling multiple modules into a single executable |
Date: | Sun, 16 Oct 2016 21:13:49 +0000 |
Oh. Thanks. Can you generate a .import without compiling your module?
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.
_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users
[Prev in Thread] | Current Thread | [Next in Thread] |