- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
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
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
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
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
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!!
링크가 복사됨
2 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Thanks!! Your hint worked. Ihadlinked the files in a wrong order!!
