Modules question

Bill Gribble grib@linuxdevel.com
16 Aug 2001 06:45:27 -0500


On 16 Aug 2001 01:11:42 -0400, James LewisMoss wrote:
> 
> OK.  With a few -l's in appropriate Makefile.am's I can get this guile
> script: 
> ----------------------------------------------------------------------
> (set! %load-path (cons "/usr/share/gnucash/guile-modules" (cons "/usr/share/gnucash/scm" %load-path)))
> (define (append-path pathname val) (let* ((current (getenv pathname)) (new-value (if current (string-append current ":" val) val))) (setenv pathname new-value)))
> (append-path "GNC_LIBRARY_PATH" "/usr/lib/gnucash")
> (append-path "LD_LIBRARY_PATH" "/usr/lib/gnucash")
> (append-path "LD_LIBRARY_PATH" "/usr/lib")
> (use-modules (gnucash gnc-module))
> (gnc:module-system-init)
> ----------------------------------------------------------------------
> 
> to run just fine, but when I run:
> ----------------------------------------------------------------------
> (gnc:module-load "gnucash/backend/file" 0)
> ----------------------------------------------------------------------
> 
> I get the message:
> ----------------------------------------------------------------------
> Failed to open module gnucash/backend/file: could not locate gnucash/backend/file interface v.0
> #f
> ----------------------------------------------------------------------
> 
> So what could I be missing?  

It's GNC_MODULE_PATH, not GNC_LIBRARY_PATH, that's searched for
gnc-modules. GNC_MODULE_PATH is empty, meaning it just searches a
default path (/usr/lib I think). 

> Was planning on adding some debugging to
> output the module system hash table to scheme, but thought I'd ask
> before I got to bed in case someone (bill?) has an idea what might be
> wrong. 

There's a function already that returns the module info as a GList.. I'm
not sure if it's g-wrapped.  That's probably a good place to start. 

b.g.