[MLton-user] Linking issues with FFI on Vista

Matthew Fluet fluet at tti-c.org
Mon Sep 8 08:05:50 PDT 2008


On Mon, 8 Sep 2008, John Reppy wrote:
> Thanks for the information.  With the addition of "public" annotations, I can now get the program to link, but I get some strange warnings:
>
>  Warning: resolving _glutDisplayCB by linking to _glutDisplayCB at 0
>  Use --enable-stdcall-fixup to disable these warnings
>  Use --disable-stdcall-fixup to disable these fixups
>  Warning: resolving _glutReshapeCB by linking to _glutReshapeCB at 8
>  Warning: resolving _glutKeyboardCB by linking to _glutKeyboardCB at 12
>  Warning: resolving _glutVisibilityCB by linking to _glutVisibilityCB at 4

     val exportDisplay           = _export "glutDisplayCB" stdcall : (unit -> unit) -> unit;
     val glutDisplayCB           = _address "glutDisplayCB" : Ptr.t;

By _export-ing "glutDisplayCB" as a stdcall function, the C compiler 
name-mangles it so that in the object file it has the symbol 
"glutDisplayCB at 0".  MLton (nor gcc) has any reason to name-mangle the 
"glutDisplayCB" symbol in the _address expression, so there is a symbol 
mismatch.  Obviously, it is common enough that the MinGW linker attempts 
to fix them automatically.

> Also, I'm guessing that adding "public" attributes will break on 20070826?

They will be a syntax error, yes.

> Is there any chance for a new release sometime soon?

Hopefully after the shared library stuff that Wesley added is stable and 
documented.




More information about the MLton-user mailing list