chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Shared libs for executables and interpreter


From: MichaelL
Subject: [Chicken-users] Shared libs for executables and interpreter
Date: Sat, 4 Jun 2005 19:07:17 -0400

Is it possible to build a shared library that works from both the 
interpreter and a compiled "main" executables?

If I have a file like this:

        (declare (unit adder))

        (define (add x y)
                (+ x y))


I have to remove the "declare" to get it to load into the interpreter 
without error, and I have to add it to use the unit as a shared library 
from a Chicken executable.

I'm using 1.89 on Windows, and I'm compiling the library with the -dll 
switch like this:

        adder.dll: adder.scm
                csc adder.scm -dll

The executable that uses the library looks like this:

        (require-extension adder)

        (print (add 2.0 2.0))

The error I get in the interpreter if the declare is present looks like 
this:

#;1> (require-extension adder)
; loading .\adder.dll ...
Error: unbound variable: |MZ\É\ \♥\ \ \ \♦\ \ \ \ \ \ \ \╕\ \ \ \ \ \ \ @\ 
\ \ \
 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \α\ \ \ 
\♫\▼\║\♫\
 \┤|

reply via email to

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