[MLton-user] SVN r6941 MLton/MinGW32 and FFI

Wesley W. Terpstra wesley at terpstra.ca
Tue Nov 11 01:00:31 PST 2008


On Tue, Nov 11, 2008 at 1:43 AM, Dan DuVarney
<duvarney at reactive-systems.com> wrote:
> For example, in /doc/examples/ffi I am observing the following behavior:
>
> bash-3.1$ make test_quot
> mlton -default-ann 'allowFFI true' test_quot.sml c_quot.o
> C:\DOCUME~1\Dan\LOCALS~1\Temp\fileT2zfil.o:fake:(.text+0x2fbe):
> undefined reference to `__imp__c_quot'
> C:\DOCUME~1\Dan\LOCALS~1\Temp\fileT2zfil.o:fake:(.text+0x35f0):
> undefined reference to `__imp__call_sml_quot'

I guess that you _export the function call_sml_quot, and then import
it back? Or that call_sml_quot comes from a library you are linking
with statically (not dynamically via a DLL)?

See http://mlton.org/LibrarySupport , suggestions to improve the
documentation are welcome.

The short answer: wherever you are using _import "call_sml_quot" you
probably need _import "call_sml_quot" private or public. Which depends
on what you're doing.



More information about the MLton-user mailing list