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

Fortran DLL calling another Fortran DLL

charlesdayan
초급자
603 조회수
It should be simple:the first dll take the array and multiply its elements by 7 and the second one multiply by 10. (The real code is a bit more complex :) )
DLL 1:
Subroutine TIMES70(x)
implicit none
!DEC$ATTRIBUTES DLLEXPORT :: TIMES70
!DEC$ATTRIBUTES ALIAS : 'TIMES70' :: TIMES70
INTERFACE
SUBROUTINE TIMES10 (rarray)
!DEC$ATTRIBUTES DLLIMPORT :: TIMES10
REAL(8) rarray(3, 7)
END SUBROUTINE TIMES10
END INTERFACE
Real(8) , intent(inout) :: x
dimension x(3,7)
integer :: i
integer :: j

do j=1,7
do i=1,3
x(i,j)=x(i,j)*7
end do
end do
call TIMES10(x)
end subroutine
DLL 2:
Subroutine TIMES10(x10) !
implicit none
!DEC$ATTRIBUTES DLLEXPORT :: TIMES10
!DEC$ATTRIBUTES ALIAS : 'TIMES10' :: TIMES10
Real(8) , intent(inout) :: x10
dimension x10(3,7)
integer :: i
integer :: j

do j=1,7
do i=1,3
x10(i,j)=x10(i,j)*10
end do
end do
end subroutine
Do I need to put the .lib file of the second one into the project of the first? I've tried but didn't work ! I always get this error:
unresolved external symbol __imp_TIMES10
SOME SHORT EXAMPLE SHOULD BE APPRECIATE!!
0 포인트
2 응답
Steven_L_Intel1
603 조회수
You do need to either add the .lib of the second DLL to the first project, or make the second a dependent project of the first. I don't spot any other issues.
0 포인트
charlesdayan
초급자
603 조회수
Thanks!! Your hint worked. Ihadlinked the files in a wrong order!!
0 포인트
응답