Well, the correct F# code is:

[<DllImport(@"decay.dll", EntryPoint="_result" SetLastError=true)>]
extern int _result(int *n);

let showResult (N : int) =
let mutable lda = N
_result ( &&lda );

Anyway, the function was still printing a strange value. I have discovered the problem is in the Fortran compiler. I have compiled the fortran code using another compiler and all works fine.

I hope this could help.

By on 2/3/2009 2:35 AM ()

Whait is your fortran compiler?
Peronnaly I have Interl fortran and F# and I have no problem to call fortran from F#.

By on 2/3/2009 3:44 AM ()

I was using Open Watcom Fortran, an open source tool. Finally, I have downloaded the Intel Fortran compiler and all works fine.

By on 2/3/2009 5:34 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper