[plt-scheme] collection not found: "scheme" in embedding mzscheme with v4.x

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jul 31 07:53:12 EDT 2008

At Thu, 31 Jul 2008 19:16:33 +0800, "Zhang Chiyuan" wrote:
> I noticed recently that mzscheme upgraded to a new version. I upgraded
> it and found my program broken. I read the Inside PLT scheme and found
> that now I need to do scheme_namespace_require so I added the line to
> require "scheme/base" but I got an error:
>     scheme/base: standard-module-name-resolver: collection not found:
> "scheme" in any of: () in: scheme/base
>     Seg fault (internal error) at 0x4
> I copied the example code in "Inside PLT scheme" and tried, still the
> same problem. Here's the code I use:
> <-----------------------------------------------------------------
> #include "scheme.h"
> [...]
>     MZ_GC_REG();
>     v = scheme_intern_symbol("scheme/base");
>     scheme_namespace_require(v);

In the manual, there's a `declare_modules(e);' line before the call to
scheme_namespace_require(). The declare_modules() function is defined
by the `#include "base.c"' line, where "base.c" is created by

   mzc --c-mods base.c ++lib scheme/base

See also the 4th bullet in section 1.3.1. In general, you need to

 * create embedded module declarations using `mzc --c-mods', or

 * set a path to the "collects" directory using
   scheme_init_collection_paths() and scheme_set_collects_path().


Posted on the users mailing list.