chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Problem with creating extensions


From: Thomas Hintz
Subject: Re: [Chicken-users] Problem with creating extensions
Date: Wed, 16 Oct 2013 09:21:48 -0700

Greetings Pluijzer,

I think you need to put your hello.scm code in a module. You can do
something like this:

in hello.scm:

(module hello (hello)
(define (hello name)
    (print "Hello, " name " !"))
)

You can find more info on modules here: <http://wiki.call-cc.org/man/4/Modules>

All the best,
Thomas Hintz

On Wed, Oct 16, 2013 at 8:12 AM, pluijzer . <address@hidden> wrote:
> Hello everybody,
>
> I fail to get extensions that I have created and installed via
> 'chicken-install' to load.
>
> For example (using the example from the documentation):
>
> /tmp/hello $ cat hello.scm
> (define (hello name)
>     (print "Hello, " name " !"))
>
> /tmp/hello $ cat hello.setup
> (compile -s hello.scm)
> (install-extension 'hello "hello.so")
>
> /tmp/hello $ cat hello.meta
> ((author "Me")
>  (synopsis "A cool hello-world library")
>  (license "GPLv3")
>  (files "hello.scm" "hello.setup"))
>
> /tmp/hello $ chicken-install
> retrieving ...
> checking platform for `hello' ...
> checking dependencies for `hello' ...
> install order:
> ("hello")
> installing hello: ...
> changing current directory to .
>   /usr/bin/csi -bnq -setup-mode -e "(require-library setup-api)" -e "(import
> setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version
> '(\"hello\" \"\"))" hello.setup
>   /usr/bin/csc -feature compiling-extension -setup-mode    -s hello.scm
>   cp -r hello.so /var/lib/chicken/6/hello.so
>   chmod a+r /var/lib/chicken/6/hello.so
>   chmod a+r /var/lib/chicken/6/hello.setup-info
>
> /tmp/hello $ csi -p '(use hello)'
>
> Error: (import) during expansion of (import ...) - cannot import from
> undefined module: hello
>
>     Call history:
>
>     <syntax>      (use hello)
>     <syntax>      (##core#require-extension (hello) #t)
>     <syntax>      (##core#begin (##core#begin (##core#begin (##sys#require
> (quote hello))) (import hello)) (##core#und......
>     <syntax>      (##core#begin (##core#begin (##sys#require (quote hello)))
> (import hello))
>     <syntax>      (##core#begin (##sys#require (quote hello)))
>     <syntax>      (##sys#require (quote hello))
>     <syntax>      (quote hello)
>     <syntax>      (##core#quote hello)
>     <syntax>      (import hello)    <--
>
> Some extra information:
>
> /tmp/hello $ csi -p '(repository-path)'
> /var/lib//chicken/6
>
> /tmp/hello $ ls /var/lib/chicken/6/hello.*
> /var/lib/chicken/6/hello.setup-info  /var/lib/chicken/6/hello.so
>
> /tmp/hello $ csi -version
>
> CHICKEN
> (c)2008-2011 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 4.7.0
> linux-unix-gnu-x86 [ manyargs dload ptables ]
> compiled 2011-09-06 on murphy (Linux)
>
> ---
> I am using Debain Wheezy
>
> Am I making a silly mistake, have I forgotten something?
>
> Thank you in advance,
> Pluijzer
>
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>



reply via email to

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