Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29267 Discussions

DLL subroutines cross-calling problem...

deeptii
Beginner
490 Views
hi! i am compiling this DLL that has several different subroutines in separate files. some subroutines make use of the others in the same DLL, and i want to make every subroutine available for calling in the DLL. so it was like this...:

subroutine A (a1, a2)
!DEC$ ATTRIBUTES DLLEXPORT :: A
!DEC$ ATTRIBUTES ALIAS:'A' :: A

B (a1,a2)
return
end

subroutine B (b1,b2)
!DEC$ ATTRIBUTES DLLEXPORT :: B
!DEC$ ATTRIBUTES ALIAS:'B' :: B

b1 = b1 + b2
return
end



but when i compile this, it will give me an error that in A it cannot find external symbol B. if i delete the DLLEXPORT statements in B, it works fine, however, B will not be callable in VB... which i want it to be callable too...

any help please?
0 Kudos
1 Reply
james1
Beginner
490 Views
You need to reference an interface block defining the B interface within the A routine.

interface
subroutine B (b1,b2)
!DEC$ ATTRIBUTES DLLEXPORT :: B
!DEC$ ATTRIBUTES ALIAS:'B' :: B
... and formal parameter declarations ...
end subroutine B
end interface

James
0 Kudos
Reply