FFI imported function names

Daniil Elovkov daniil.elovkov at googlemail.com
Wed Dec 24 10:44:32 EST 2008


How is decided whether the name of imported function gets the ending
of the form @4 in ghc?

I'm having this problem on Windows trying to use HSQL MySQL on windows.

I compile HSQL Oracle backend and I get names without that. It's ok.
With HSQL MySQL I get names with that stuff. It prevents me from
further linking to dll. Supplying in the ghc command-line the "lib"
file where names have those marks doesn't have any effect.

The linker says that fname at NN cannot be resolved.

Can I control that?

The ffi calling convention doesn't (and shouldn't as I understand)
affect this. The only difference is that in the case of mysql the
header file itself where functions are described marks it STDCALL. Is
that the reason?

Also I changed ffi import line from "hsmysql.h func" to just "func",
to no avail.

ghc 6.8.2

I'm lost. Please help.

Daniil Elovkov

More information about the Glasgow-haskell-users mailing list