<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>The warning is just a warning.  It's a common message from Gambit when dynamically loading libraries.  The issue is that when a library is loaded, it references a few functions which don't exist yet.  Most likely these requirements will fulfilled by loading other libraries which define those functions.  For example:</div><div><br></div><div>;;test.scm</div><div><div>(c-define (foo) () void "foo" ""</div><div>    (bar)) </div><div><br></div><div>;;test2.scm</div><div>(define (bar)</div><div>    (display "hello"))</div></div><div><br></div><div>% gsc test.scm</div><div>% gsi</div><div>Gambit v4.3.2</div><div><br></div><div><div>> (load "test")</div><div>*** WARNING -- Variable "bar" used in module "test.o1" is undefined</div><div>"~/test.o1"</div><div>> (load "test2")</div><div>"~/test2.scm"</div><div>> (foo)</div><div>hello></div><div><br></div><div>So it's probably just a timing issue.  You could add `(load "test")' at the top of wrapper.scm and compile wrapper.scm, and then run `gsi wrapper.o1' instead.</div></div><br><div><div>On Jan 19, 2009, at 8:48 PM, TongKe Xue wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Sorry, that last line should say:<br><br>gsi test.scm<br>*** WARNING -- Variable "disp" used in module "wrapper-s" is undefined<br><br><br><br><div class="gmail_quote">On Mon, Jan 19, 2009 at 5:43 PM, symbolic expression <span dir="ltr"><<a href="mailto:symbolic.expression@gmail.com">symbolic.expression@gmail.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">hi!<br><br>  I have wrapper.scm (which is compiled code), and test.scm (which is interpreted)<br> <br>  i.e. (compile-file-to-c "wrapper"); (link-flat '("wrapper ...) output: "blah.o1.c"); gcc -shared -fPIC ... blah.o1.c -o blah.o1<br> <br>  test.scm:<br>  (load "blah")<br>  ...<br><br>  and I run everything with "gsi test.scm"<br><br>  Now, here's the problem. In test.scm, I need to call a glutDisplayFunc, which requires a _C_ callback. Okay, so I define function with (c-define (c-disp ...) ... (disp)). (disp) is the scheme funfction that does the real workd; c-disp is a c wrapper around disp. Since test.scm is interpted, I have to put it in wrapper.scm -- however, I want to keep disp in test.scm (rapid prototypinhg, changing it on the fly, etc ...). Question is, how can I get c-disp (which is in wrapper.scm) to get call (disp), which is in test.scm?<br> <br>  if I just do wrapper.scm:<br><br>(c-define (c-disp) () void "f" "" (disp))<br><br>  and test.scm:<br>(load "graphics")<br><br>;(c-define (c-disp) () void "f" "" (disp))<br>           <br>(define (disp)<br>  (glClear GL_COLOR_BUFFER_BIT)<br>  (glutWireTeapot 0.5))<br><br>and run gsi test.scm, I get:<br><br>$gsi test.scm<br>*** WARNING -- Variable "format" used in module "wrapper-s" is undefined<br> <br>so the question is ... how can i get compile scheme code to 'wait' in order to call interpted scheme code?<br><br>thanks!<br> <br>_______________________________________________<br> Gambit-list mailing list<br> <a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br> <a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br> <br></blockquote></div><br> _______________________________________________<br>Gambit-list mailing list<br><a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list<br></blockquote></div><br></body></html>