[MLton-user] A few questions

Matthew Fluet fluet at tti-c.org
Sun Dec 16 11:15:19 PST 2007


On Sun, 16 Dec 2007, David Hansel wrote:
> Thanks,  that got me somewhat further.  Next problem I am facing is
> (apparently) about the "Time.now()" function.  Trying to compile the
> following code:
>
> fun foo() = Time.now()
> val _ = print("Hello World!\n")
>
> results in "undefined reference to _Time_sec and _Time_usec" errors.
> If I just add stubs for Time_sec() and Time_usec() functions (just
> returning 0) in runtime/basis/System/Time.c and recompile the runtime
> then the compile goes through but when starting the executable,  nothing
> is printed.  The program just terminates,  no segfault, no unhandled
> exception but also no "Hello World".
> If I comment out the "fun foo()" line and recompile then the program
> runs fine.  Note that function foo is never actually called.
> Any ideas what could be going on and how to fix it properly?

I think your source tree is out of date; I recently committed changes to 
the runtime/basis/System/Time.c, along with corresponding changes to 
/basis-library/system/time.sml:
   http://mlton.org/pipermail/mlton-commit/2007-December/002275.html
You need to 'make runtime ; make basis' to push the changes from both the 
runtime and the basis to the 'build' directory.

BTW, I recommend moving any furthe discussion of a Win64/MinGW port to the 
mlton at mlton.org (development) mailing list.



More information about the MLton-user mailing list