Question: define_external : importing a Fortran subroutine problem

Hi,

I'm working on a computational physics project and prefer to use Fortran codes (compiled by MVS-9) with Maple power together.

In recent days I've changed some compiler options in MVS and unfortunatly (I don't remember the options) nothing works well as before.

For example, as I try to use a simple code like this:

SUBROUTINE add1( a, b , c)
  !DEC$ ATTRIBUTES DLLEXPORT::add1
  !DEC$ ATTRIBUTES ALIAS: 'add_' :: add1
    ! Variables
IMPLICIT NONE
     INTEGER, intent(in) :: a
     INTEGER, intent(in) :: b
     INTEGER, intent(out) :: c
 ! Body
    c = a + b
END SUBROUTINE add1

 

with stdcall option running the code with maple results in nothing and I found out the arguments were passed incorrectly to the routine.

without stdcall option the program runs but at the end there is a mserver crash.

Anyone can help me on this problem?

Please Wait...