[gambit-list] Linkage order will affect behavior of same code?

Meng Zhang wsxiaoys.lh at gmail.com
Tue Dec 6 21:27:01 EST 2016


I have three scm files:

main.scm:

(display "Hello from main.scm.")
(newline)
(f1a-func)
(f2-func)

f1a.scm:
(define (f1a-func)
  (display "f1a-func was called")
  (f2-func)
  (newline))

f2.scm:
(define (f2-func)
  (display "Hello from f2.scm")
  (newline))

With gcc f1a.o f2.o main.o main_.o -lgambit, it compiles and generate
expected output.
With gcc main.o f1a.o f2.o main_.o -lgambit, it compiles but will raise an
exception on missing f1a-func / f2-func.

Is this expected behavior? Any workaround exist? My testing environment is
OSX El Captain

Thanks
Meng


-- 
Meng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20161206/b6c8ed62/attachment.htm>


More information about the Gambit-list mailing list