[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] how do i load a module? none of the docs seem to hel
From: |
Evan Hanson |
Subject: |
Re: [Chicken-users] how do i load a module? none of the docs seem to help... :( |
Date: |
Sat, 10 Aug 2019 12:25:44 +1200 |
Hi Kay,
On 2019-08-09 17:19, masukomi wrote:
> I then generate `hello.import.scm` and `hello.so` with `csc`
>
> What _exactly_ do i need to put in code in order to import the `hello`
> module in such a way that when I compile the thing importing it with
> `csc -static thing-importing-hello.scm` I don't get "csc: could not
> find linked extension hello"
hello.so is a dynamic library, so it won't work when compiling the
program with -static. For that, you need to compile hello.scm to an
object file and link it into the program. Assuming you're using CHICKEN
5.x, try this:
$ csc -unit hello -cJ hello.scm
$ csc -link hello -static thing-importing-them.scm
$ ./thing-importing-them
hello world
thing-importing-them.scm can contain just the following:
(import (hello))
(greet)
Cheers,
Evan