이미지 값을 읽는 라이브러리를 작성하는 동안 다음과 같은 문제가 발생합니다. realimage
이라는 새 유형을 정의했습니다. 이 유형 내에서 함수가 참조되며 결과로 배열을 반환합니다.유형 정의에서 호출 할 배열 값 함수
module typedefinition
implicit none
type realimage
integer :: byteorder = 0
contains
procedure :: initialize => initializereal
procedure :: pxvalues => pxvaluesreal ! Array valued function
end type realimage
contains
function pxvaluesreal(this, x, y) result(val)
implicit none
type(realimage) this
real val(5)
integer :: x, y
...
end function
end module
gfortran와 모듈을 컴파일하고 image1%pxvalues(x,y)
으로 함수를 호출, 나는 항상 다음과 같은 오류 메시지가 얻을 : 내가 직접 메인 프로그램 (pxvaluesreal(image1,x,y))
에서 함수를 호출하는 경우
main.f95: In function ‘testtype’:
main.f95:15: internal compiler error
를, 모든 작동합니다.
형식 정의에서 배열 차원을 정의하여 컴파일러에 알릴 수 있습니까?이 함수는 함수의 반환 값의 차원이 아닙니까?