I am trying to P / invoke the C library from F # and am facing a particular problem. I have a module containing all my functions extern. The C base library has two functions with the same name but different arguments. This, of course, is not allowed in the F # module.
module C =
open System.Runtime.InteropServices
[<DllImport("libc", CallingConvention = CallingConvention.Cdecl)>]
extern int setValue(nativeint source, int value)
[<DllImport("libc", CallingConvention = CallingConvention.Cdecl)>]
extern int setValue(nativeint source, string value)
Is there any special way around this? I cannot change the C library.
source
share