Andrew; That was my problem - when I removed the STDCALL it now works great!
Thanks for your help - Jeff -----Original Message----- From: Andrew Makhorin [mailto:[email protected]] Sent: Friday, March 25, 2011 2:20 PM To: Kelly, Jeff (ON0F) Cc: [email protected] Subject: RE: [Help-glpk] "Assertion failed: 1 <= p && p <= T->nslotsErrordetected in file ..\src\glpios03.c at line 116" On Fri, 2011-03-25 at 13:27 -0400, Kelly, Jeff (ON0F) wrote: > Andrew; > > Thanks. > > My callback subroutine shown below in Fortran (sorry) uses the tree as an integer pointer and passes this to glp_ios_curr_node(). And, even when glp_ios_curr_node() is not used in the callback subroutine I still get the assestion failure. > > Therefore I take it that I am somehow corrupting the tree structure inadvertently. > > I am wondering if there is anything else I can do? other then chalking it up as a Fortran to C "inoperability" issue. > > Regards, Jeff > > subroutine GLPKintsolcb(tree,info) > cDEC$ ATTRIBUTES DLLEXPORT, STDCALL, REFERENCE, ALIAS : "GLPKINTSOLCB" :: GLPKINTSOLCB > > integer(4), intent(in) :: tree > cDEC$ ATTRIBUTES REFERENCE :: tree > integer(4), optional, intent(in) :: info > cDEC$ ATTRIBUTES REFERENCE :: info > > interface > > integer(4) function glp_ios_curr_node(tree) > cDEC$ ATTRIBUTES DLLIMPORT, STDCALL, ALIAS : "_glp_ios_curr_node" :: glp_ios_curr_node > integer(4) :: tree > cDEC$ ATTRIBUTES REFERENCE :: tree > end function > > end interface > > !comment write(*,*)glp_ios_curr_node(tree) > > end subroutine GLPKintsolcb > There is definitely something wrong with parameter passing. If you are using glpk dll compiled with MSVS, please note that it uses _cdecl calling convention, not _stdcall. _______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
