- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I recently met a problem with error message "error #6457: This derived type name has not been declared. [DRTYP]" in my code.
module derivetypetest
implicit none
!DEC$ IF DEFINED (abc)
type StringPointer
character (len=1), pointer :: sp
end type StringPointer
!
type drtyp
integer dim, size
integer (kind=IntKind), pointer :: array(:,:)
end type drtyp
!DEC$ ELSEIF DEFINED (def)
type drtyp
integer size
integer (kind=IntKind), pointer :: array(:)
end type drtyp
!
character (len=1), private, allocatable :: whatever(:)
!DEC$ ENDIF
private :: drtyp
type(drtyp), private:: drtyparr(5)
end module derivetypetest
A workarround I used is that I put
private :: drtyp
type(drtyp), private:: drtyparr(5)
in !DEC$ IF and !DEC$ ELSEIF.
May I ask if there's other option to keep the codes in the original form?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If neither abc nor def is defined, you should expect that error message. Maybe you could put a !DEC$ ELSE clause in there that defines TYPE(drtyp) in that case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! This works.
Repeat Offender wrote:
If neither abc nor def is defined, you should expect that error message. Maybe you could put a !DEC$ ELSE clause in there that defines TYPE(drtyp) in that case.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page