[plt-scheme] Using a C/C++ extension in a module

From: Agnes Schemelt (highflyer451 at hotmail.com)
Date: Wed Apr 9 11:24:58 EDT 2003

>From: "Paul Steckler" <steck at ccs.neu.edu>
>Create a module within the extension that exports the desired
>bindings.  Then use `require' to import that module.

Hi. Thanks for your reply. This is one of the methods suggested by others, 
but it doesn't work. For testing, I used idmodule.c from 
collects/mzscheme/examples. And I loaded it into a module "useme.ss", 
defined as follows:

     (module useme mzscheme
         (load-extension "idmodule.dll")
         (require idmodule)  ;; ERROR: says idmodule not bound!!
         (provide identity)  ;; The only exposed function
     )

When I use the useme module: (require (lib "useme.ss" "mycoll")), it says 
that the idmodule is not bound.

Strangely, at the top level this sequence works fine:
    (load-extension "idmodule.dll")
    (require idmodule)

Am I using it right? Is an extension designed to be used in a module in the 
first place? Thanks for your help.

-- Agnes

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail



Posted on the users mailing list.