[racket-dev] unable to embed racket in a C++ program

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Sep 22 09:04:56 EDT 2012

The "%RACKETDIR%" in scheme_make_path() isn't going to get expanded as
an environment variable. You'll have to use getenv() directly:

 a[0] = scheme_make_path(getenv("RACKETDIR"));
 a[1] = scheme_make_path("collects");
 Scheme_Object * collectPath = scheme_build_path(2, a);
 Scheme_Object * collectPathList = scheme_build_list(1, &collectPath);
 scheme_init_collection_paths(e, collectPathList);


At Fri, 21 Sep 2012 16:42:23 -0700, Dan Liebgold wrote:
> I'm having a terrible time trying to embed Racket 5.3 in a C++ program.
> Please take a look at https://gist.github.com/3764529 and tell me where I'm
> going wrong.
> 
> This is the output I get:
> 
> racket/base: standard-module-name-resolver: collection not found
>   collection: "racket"
>   in collection directories:
>    C:\Users\danl\AppData\Roaming\Racket\5.3\collects
>   in: racket/base
>   context...:
>    standard-module-name-resolver
> 
> 
> RACKETDIR environment variable is defined properly (and not to the path in
> the output.) Any ideas?
> 
> -- 
> Dan Liebgold    [dan.liebgold at gmail.com]
> _________________________
>   Racket Developers list:
>   http://lists.racket-lang.org/dev

Posted on the dev mailing list.